diff --git a/src/Mod/TechDraw/Gui/MDIViewPage.cpp b/src/Mod/TechDraw/Gui/MDIViewPage.cpp index 0f4b08d8e59c..0df030f06289 100644 --- a/src/Mod/TechDraw/Gui/MDIViewPage.cpp +++ b/src/Mod/TechDraw/Gui/MDIViewPage.cpp @@ -571,7 +571,12 @@ void MDIViewPage::printPdf(std::string file) printer.setFullPage(true); printer.setOutputFormat(QPrinter::PdfFormat); printer.setOutputFileName(filename); - printer.setOrientation(m_orientation); +// printer.setOrientation(m_orientation); + if (m_paperSize == QPrinter::Ledger) { + printer.setOrientation((QPrinter::Orientation) (1 - m_orientation)); //reverse 0/1 + } else { + printer.setOrientation(m_orientation); + } printer.setPaperSize(m_paperSize); print(&printer); } @@ -728,8 +733,8 @@ QPrinter::PaperSize MDIViewPage::getPaperSize(int w, int h) const {105, 241}, // US Common {110, 220}, // DLE {210, 330}, // Folio - {431.8f, 279.4f}, // Ledger - {279.4f, 431.8f} // Tabloid + {431.8f, 279.4f}, // Ledger (28) note, two names for same size paper (ANSI B) + {279.4f, 431.8f} // Tabloid (29) causes trouble with orientation on PDF export }; QPrinter::PaperSize ps = QPrinter::Custom; @@ -739,13 +744,19 @@ QPrinter::PaperSize MDIViewPage::getPaperSize(int w, int h) const ps = static_cast(i); break; } - else + else //handle landscape & portrait w/h if (std::abs(paperSizes[i][0]-h) <= 1 && std::abs(paperSizes[i][1]-w) <= 1) { ps = static_cast(i); break; } } + if (ps == QPrinter::Ledger) { //check if really Tabloid + if (w < 431) { + ps = QPrinter::Tabloid; + } + } + return ps; } diff --git a/src/Mod/TechDraw/Templates/ANSIB_Portrait.svg b/src/Mod/TechDraw/Templates/ANSIB_Portrait.svg new file mode 100644 index 000000000000..8d4adcf7ce18 --- /dev/null +++ b/src/Mod/TechDraw/Templates/ANSIB_Portrait.svg @@ -0,0 +1,448 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Drawn: + Checked: + Approved: + Approved: + Company Name + 1234 Main St + Drawing Title 1 + Drawing Title 2 + Drawing Title 3 + Drawing Number + Rev + Drawn By + Checked By + Approved 1 + Approved 2 + Scale + Code + B + Weight  + Sheet n of m + +