Bug 691282 - Physical width of raster graphic too large
Summary: Physical width of raster graphic too large
Status: RESOLVED INVALID
Alias: None
Product: GhostPCL
Classification: Unclassified
Component: PCL raster (show other bugs)
Version: master
Hardware: All Linux
: P4 normal
Assignee: Ken Sharp
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-05 12:36 UTC by Joe
Modified: 2014-01-02 01:34 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments
pcl data prints a barcode (3.05 KB, application/octet-stream)
2010-05-05 12:37 UTC, Joe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe 2010-05-05 12:36:49 UTC
attached barcode.prn prints a barcode in landscape orientation
400 dots at raster grahpics resolution 150 dpi

Physical size should be 400/150 inches or 67.7 mm.
In the pdf generated by pcl6, the barcode measures more than 70 mm.

pcl6 command line:
pcl6-11182 -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=barcode.pdf '-J@PJL SET PAPER=A4' barcode.prn
Comment 1 Joe 2010-05-05 12:37:55 UTC
Created attachment 6254 [details]
pcl data prints a barcode
Comment 2 Henry Stiles 2010-05-07 20:12:08 UTC
Yes pcl to a normal raster device (ppmraw, png16m etc.) seems okay even with varying the device's resolution but the pdfwrite output is scaled incorrectly.  Assigning to ken who manages pdfwrite, but he is fairly busy with customer problems and I don't know when he'll have a chance to look at this soon.
Comment 3 Ken Sharp 2014-01-02 01:34:40 UTC
The 'problem' is caused by using the default pdfwrite resolution of 720 dpi, for PCL you should set the resolution to the PCL resolution of 600 dpi (300 dpi works as well).

Henry, when running the file to TIFF I see the same differences in the size of the graphics as when running to PDF, varying with resolution. Using tifflzw I set four different resolutions, 600, 720, 1000 and 100 (at 72 dpi the images disappear). I then used an image editor to find the pixel positions of the top part of the highest bar, and the bottom part of the lowest bar. These were as follows (0,0 = top left)

100 dpi: top = 782, bottom = 1079 = 297 pixels = 2.97 inches.

600 dpi: top = 4699, bottom = 6298 = 1599 pixels = 2.665 inches

720 dpi: top = 5639, bottom = 7638 = 1999 pixels = 2.776 inches

1000 dpi: top = 7832, bottom = 10631 = 2799 pixels = 2.779 inches.

My suspicion is that the actual size of the barcode is in fact 2.779 inches, but it is scaled to print correctly at 600 dpi giving the expected result. Note that barcode is not transmitted to pdfwrite as a single image, each row is transmitted as a separate image.