-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gstoraster shifts image over a bit but pdftoraster is correct #138
Comments
Further info -- I'm submitting these images on the command line using 'lp', to a local queue. The printer in this specific instance is a USB-attached DNP DS620, driven by git master Gutenprint. I can also supply the PPD and source image (in jpeg and pdf form) that demonstrates the problem. |
@speachy Can you share the PPD and the image for us to look upon. Probably, there is a margin offset bug in gstoraster. |
In the zip file are the PPD, and a source image in the original jpg, and converted to pdf. Note that these images have (symmetrical) borders, which makes it pretty easy to see if/how the image gets shifted. I used PageSize=w432h648 Resolution=300dpi. |
The paper size information in the PPD for the "w432h648" is as follows:
From a paper size named "w432h648" or "6x9" I expect that it is 6 inches by 9 inches or 432 pt by 648 pt. Thebactual dimensions defined in the PPD file are bigger. Also strange is that there is only an unprintable border defined for the X dimension and not for the Y dimension (but the actually printable area is still bigger than the expected physical paper size of 432 pt by 648 pt). |
(The above was printed using the 6x8"/432x576pt size, but the problem is more general) The short answer is that, yes, these dimensions are needed to satisfy both the printer's raster data format requirements and "overspray" for full-bleed printing. The final image is "nominally" 432x576pt, but the printer has a native imageable area of 1844x2436px @300dpi (442.56x584.64pt) with a non-printable 38px/9.12pt margin on either side, resulting in (from the printer's perspective) a raster of 1920x2436px/460.80x584.64pt. The results were achieved using CUPS (submitting the PDF on an lpr command line) but one way or another I'll get you the logs from each run. Oh, I recall seeing similar problems when printing (again with Gutenprint) to a more traditional PCL5 laser, but I never bothered to dig into that one. |
I have tested now with
and the files you supplied in the current directory. When I display the resulting file with
I have checked
Important is to set the |
Reported to upstream ghostscript at https://bugs.ghostscript.com/show_bug.cgi?id=701438 They seem to think it's a problem with how pstopdf invokes ghostscript, and suggested a different cmdline. See comment 5. |
See my comment #6 on the Ghostscript bug report for more detailed info. |
To echo what I put in the ghostscript ticket. I didn't file this bug due to "application" or "user" confusion, I filed it because 'gstopdf' and 'pdftopdf' generate inconsistent results with the same input and (explicit) parameters. |
The input image is perfectly filtted to the imageable area for the print size. The behavior with a non-PDF (ie raster) flow is already correct, and pdftopdf behaves consistently with that. It's one thing to claim that gutenprint's decade-plus-old approach to non-printable paper margins is incorrect (I suspect this would come as a surprise to Robert Krawitz) but I don't think I'm being unreasonable in expecting consistent output no matter which pdf->pdf filter is used. |
So far the solution presented is "rewrite your printer driver to reduce user confusion" -- but the user here was not confused by a PageSize that is larger than the ImageableArea. Instead, they were confused as to how this series of commands would yield different results: ]$ user_application input.jpg outimage.jpg # generates output perfectly fitting ImageableArea They were confused because that last command used to work. And that is how this was reported to me. |
Now both gstoraster and pdftoraster should do the right thing. Both now support also matching the input page size against the imageable area of the PPD's page sizes (if none of the PPD's sizes matches with its full size) and matching is generally done with only 1% of tolerance. Your file comes out correctly now and I also have done some regression tests and all seems to work correctly now. |
I just ran into an odd problem. I'm trying to print a full-bleed image that is perfectly sized for the printer's imagable area. If I submit the job as an image (ie jpeg), the image prints correctly.
However, if I convert the image to a pdf first and submit that, the image is offset about 3-4mm from the left of the page, leaving a white visible margin.
When debugging I noticed that the filter flow was calling 'gstoraster' for the pdf conversion. On a whim, I disabled gstoraster (commenting out the entries in mime/cupsfilters-ghostscript.convs) so that pdftoraster would be used instead, and the image printed properly centered, with correct (ie zero) margins.
It is clear that the two pdf --> raster conversion paths are not in agreement, and it is my belief that gstoraster is incorrect.
I'm using cups-filters 1.22.5 on a Fedora 30 system. cups 2.2.11, ghostscript 9.26.
A quick scan of the changelogs show nothing noteworthy vs the current 1.24.2, but I can rebuild and retest with that if necessary. I can also supply scans of the failure I'm talking about.
The text was updated successfully, but these errors were encountered: