I'm trying to open a pdf file with ghost script and having the subj error Here's the command line I'm using: gswin32c -dSAFAER -dBATCH test_13.pdf Here's what gs returns to me: Processing pages 1 through 1. Page 1 Error: /configurationerror in --setpagedevice-- Additional information: [/PageSize [2464 3228]] Operand stack: --nostringval-- --dict:5/5(L)-- --dict:6/6(L)-- Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval- - 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- fa lse 1 %stopped_push 1862 1 3 %oparray_pop 1861 1 3 %oparray_ pop 1845 1 3 %oparray_pop --nostringval-- --nostringval-- 2 1 1 --nostringval-- %for_pos_int_continue --nostringval-- 1830 3 7 % oparray_pop --nostringval-- --nostringval-- --dict:8/10(L)-- --nostringv al-- 10 %dict_continue Dictionary stack: --dict:1150/1684(ro)(G)-- --dict:1/20(G)-- --dict:74/200(L)-- --dict:74 /200(L)-- --dict:106/127(ro)(G)-- --dict:278/300(ro)(G)-- --dict:21/25(L)- - Current allocation mode is local GPL Ghostscript 8.64: Unrecoverable error, exit code 1
Created attachment 4892 [details] file which had an error
This file was opened successfully with Adobe Reader
I cannot reproduce this. Please provide more information about your system and your copy of Ghostscript. - do you have 32 or 64 bit system ? - have you installed a binary distribution or compiled from sources ? - can you run the sample file on other systems ?
- I have 32bit WinXP. - I've installed the binary distribution for gs 8.64. - Can check it on 32bit Windows Server 2003 if needed.
Created attachment 4893 [details] gs_setpd.ps
Sorry, I found the problem, I have custom gs_setpd.ps to restrict the page size to 1728 pixels. Is this possible to configure gs to scale the image if it's bigger then given size?
Ghostscript follows the PLRM-3rd edition as to how PageSize matching is performed, including choosing the media from the InputAttributes dictionary according to a fit withing +/- 5 points possibly with rotation to fit. If no page size is close enough, then the 'Policies' dict of the page device come into play. A PageSize policy value of 3 scales down pages that are too large for the largest PageSize and centers smaller pages on the closest larger PageSize. The syntax for this in a setpagedevice dictionary is: << /Policies << /PageSize 3 >> >> setpagedevice I hope this helps.
The following prefix removes all predefined input attributes and sets a single variable media size from the modified gs_setpd.ps . Under policy 3, this makes media matching algorithm to scale down the input page size to the media size. Please note that all media attributes are replaced; modified gs_setpd.ps is not needed. << currentpagedevice /InputAttributes get 0 1 2 index length 1 sub {1 index exch undef } for /InputAttributes exch dup 0 <</PageSize [0 0 612 1728]>> put /Policies << /PageSize 3 >> >> setpagedevice Run the prefix before your file as: gswin32c prefix.ps foo.pdf In any case, this is not a bug in Ghostscript.
Thank you very much for your help, I apologize for inconvenience, the issue was in my settings not in gs itself.