Summary: | In kpdf when printing pdf, the margins are interchanged. left and right are mixed up, as are top and bottom | ||
---|---|---|---|
Product: | [Applications] kpdf | Reporter: | dirkwallenstein |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | All | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Test document to demo this bug: use with kpdf; set margins; print with "Preview" enabled |
Description
dirkwallenstein
2007-09-05 11:25:43 UTC
changed $summary to take kdeprint out of the line of fire :-) Confirming this bug. I'll attach a test document which allows to better track down the problem (it's just a few nested frames centered on an A4 page). You can see how this bug exhibits itself also if you enble "Preview" in the kprinter main dialog (checkbox underneath the "Properties" button). Normally this test PDF I'll attach should be printed with zero margins (it's a full bleed page covering all available area). Set margins *really* to zero in kprinter, and the preview is as intended... Now try to set different margins and see what the preview shows in each case (I used "gv" as the PostScript viewer, enabled in "kaddprinterwizard --kdeconfig" --> Preview). The left-right margin swapping does not only occur with 'huge' margins as the report seems to suggest; it already is present in the most minimal margin. One additional bug, which is not explained by "left and right margins are swapped" is shown when you set all margins to zero, but use a bottom margin of, say 4 cm, and select "Print with specified margins". You'll notice that the image also shifts to the top, and the top area even is cropped from the page... BTW, besides the fact that the "Print Aspect Ratio" dialog does not do what it intends to, its contents are also not easy to understand... Created attachment 21549 [details] Test document to demo this bug: use with kpdf; set margins; print with "Preview" enabled This is the promised test document from my comment #2 "Print with specified margins" behaves like this in a few specific examples: * if only left and right margins are set (and top/bottom both set to "0"), then left and right are swapped, the page image is *scaled* to fit into remaining space and the image is shifted to the bottom edge (zero margin bottom, $whateverremains margin top) * if only top and bottom margins are set (and left/right both set to "0"), then the image is *NOT* scaled at all, and image is shifted upward by the amount set by bottom margin (the top margin setting is completely ignored). Try it with both top and bottom margins set to 9cm, and left/right to 0cm.... * if you repeat that, and then add a left margin of, say 4cm, you see the page image gets scaled to fit into the available width, but it is still shifted upward by 9cm.... SVN commit 708815 by aacid: Sesame Street Class #1: Left is left, Right is right Sesame Street Class #2: If you want to print parameters 0 and 1, use 0 and 1, not 0 and 0 This fixes some printing problems with margins BUGS: 149560 M +1 -1 core/generator_pdf/generator_pdf.cpp M +1 -1 xpdf/xpdf/PSOutputDev.cc --- branches/KDE/3.5/kdegraphics/kpdf/core/generator_pdf/generator_pdf.cpp #708814:708815 @@ -466,7 +466,7 @@ { pstitlechar = 0; } - PSOutputDev *psOut = new PSOutputDev(const_cast<char*>(tf.name().latin1()), const_cast<char*>(pstitlechar), pdfdoc->getXRef(), pdfdoc->getCatalog(), 1, pdfdoc->getNumPages(), psModePS, marginRight, marginBottom, paperWidth - marginLeft, paperHeight - marginTop, forceRasterize); + PSOutputDev *psOut = new PSOutputDev(const_cast<char*>(tf.name().latin1()), const_cast<char*>(pstitlechar), pdfdoc->getXRef(), pdfdoc->getCatalog(), 1, pdfdoc->getNumPages(), psModePS, marginLeft, marginBottom, paperWidth - marginRight, paperHeight - marginTop, forceRasterize); if (psOut->isOk()) { --- branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf/PSOutputDev.cc #708814:708815 @@ -3140,7 +3140,7 @@ writePSFmt("{0:.4g} {1:.4g} translate\n", tx, ty); } if (xScale != 1 || yScale != 1) { - writePSFmt("{0:.4f} {0:.4f} scale\n", xScale, yScale); + writePSFmt("{0:.4f} {1:.4f} scale\n", xScale, yScale); } if (clipLLX0 < clipURX0 && clipLLY0 < clipURY0) { writePSFmt("{0:.4g} {1:.4g} {2:.4g} {3:.4g} re W\n", |