Summary: | Page size detected incorrectly | ||
---|---|---|---|
Product: | libspectre | Reporter: | Germán Poo-Caamaño <gpoo+bfdo> |
Component: | general | Assignee: | Carlos Garcia Campos <carlosgc> |
Status: | RESOLVED MOVED | QA Contact: | Carlos Garcia Campos <carlosgc> |
Severity: | normal | ||
Priority: | medium | CC: | markus.kramer |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
URL: | https://bugzilla.gnome.org/show_bug.cgi?id=346160 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
PS test case
Another test case Another test case /PageSize inside %%BeginSetup LibSpectre ignores the A4 in setpagedevice LibSpectre reads the A4 "structuring comments" |
Description
Germán Poo-Caamaño
2013-02-17 01:05:17 UTC
Created attachment 74959 [details] Another test case Here is another test case. In this case, there is a definition of /PageSize in the line 290 of the document after BeginFeature. This was also reported in Gnome's Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=598868 Created attachment 75522 [details] Another test case /PageSize inside %%BeginSetup Another test case reported in https://bugzilla.gnome.org/show_bug.cgi?id=694636 I removed the content, but the page size definition still is there in the line 72. Created attachment 103517 [details]
LibSpectre ignores the A4 in setpagedevice
Created attachment 103518 [details]
LibSpectre reads the A4 "structuring comments"
Hello, to research this case, I have created and attached a very small test document (4corners_A4.ps). In fact the only test being tested is << /PageSize [595 842] >> setpagedevice These numbers specify A4, but Evince does render the page as Letter. The content of the page are four lines pointing into the corners of A4, to recognize the page size easily. I have read libspectre/ps.c (the C source code file) and found that libspectre ignores (does not parse) code like << /PageSize [x y] >> setpagedevice Instead, for the Page Size, libspectre relies on “document structuring comments” (starting with %%). I find this far from optimal, because comments are the only source of PageSize information, while there is a language feature that is ignored, and there are PostScript documents and generators that are unaware of these comments. This is confusing. The two “structuring comment” blocks below are needed to convince libspectre of A4, I found by trial and error. The code is in the second attachment (4corners_A4_libspectre.ps). I am very surprised that a missing %%Page comment even generates a Syntax error. I would like to suggest that reading the page size from << /PageSize [x y] >> setpagedevice” would make libspectre a more robust library. Who is the current maintainer of the code? Best regards, Markus BLOCK 1 ------ at the beginning of the document %%BoundingBox: 0 0 595 842 %%Orientation: Portrait %%PageOrder: Ascend %%DocumentMedia: 595 842 %%DocumentPaperSizes: a4 %%EndComments %%BeginDefaults %%PageBoundingBox: 0 0 595 842 %%PageOrientation: Portrait %%EndDefaults %%BeginSetup %%PageBoundingBox: 0 0 595 842 %%PaperOrientation: Portrait %%PaperSize: a4 %%EndSetup BLOCK 2 ------ at each page %%Page 1 -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/libspectre/libspectre/issues/17. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.