pts / pdfsizeopt

PDF file size optimizer
GNU General Public License v2.0
762 stars 66 forks source link

Ghostscript 9.50 compatibility: warning about the .setpdfwrite operator #134

Closed necros2k7 closed 4 years ago

ranamm commented 4 years ago

We are currently moving our process to from Linux5 which has gs v8.70 to Linux7 which has gs v9.25

'/usr/local/bin/gs -dCompatibilityLevel=1.4 -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=' || p_Dest_Folder || '/o' || v_Request_ID || '.out.pdf -sDEVICE=pdfwrite -c .setpdfwrite -f ' || p_Dest_Folder || '/o' || v_Request_ID || '.out', p_Dest_Folder || '/myLog'|| v_Request_ID ||'.txt'

from the command line it's working using the below

gs -dCompatibilityLevel=1.4 -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=/u01/apps/out/test.out.pdf -sDEVICE=pdfwrite -c .setpdfwrite -f /u01/apps/out/test.out >> /u01/apps/out/myLogtest.txt

Can you please advise ?

necros2k7 commented 4 years ago

I`m Win user, sorry ) I can check this command I guess though gs -dCompatibilityLevel=1.4 -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=/u01/apps/out/test.out.pdf -sDEVICE=pdfwrite -c .setpdfwrite -f /u01/apps/out/test.out >> /u01/apps/out/myLogtest.txt

necros2k7 commented 4 years ago

I did "gswin32c" -dCompatibilityLevel=1.4 -q -dSAFER -dNOPAUSE -dBATCH -sOutputFile=test2.pdf -sDEVICE=pdfwrite -c .setpdfwrite -f test.pdf >> myLogtest.txt

test.pdf test2.pdf

**** WARNING: The .setpdfwrite operator has been deprecated and will be removed entirely in the next release of Ghostscript. The functionality of this operator has been reduced to increasing the size of the VM threshold. If you believe you have a real need for this then you should replace your call to .setpdfwrite with:

              3000000 setvmthreshold
pts commented 4 years ago

pdfsizeopt, when installed as described on https://gitthub.com/pts/pdfsizeopt, contains an instance of Ghostscript which is compatible with pdfsizeopt.

There is no need to upgrade or downgrade other instances of Ghostscript on the system.

If you install pdfsizeopt according to the installation instructions, and you are still getting Ghostscript errors or warnings, please open a separate issue.

necros2k7 commented 4 years ago

I don`t mean update to system , I meant update pdfsizeopt package with new version

pts commented 4 years ago

I don't understand the problem here. When you run pdfsizeopt, do you get a warning or error? If yes, then please reinstall pdfsizeopt according to the installation instructions in https://gitthub.com/pts/pdfsizeopt, then rerun it, and then copy-paste the full output here, and attach the input and output files.

Do you run some other tool (such as gswin32c) manually? If yes, please report any problems to the authors of that tool, not pdfsizeopt.

Please note that the pdfsizeopt contains a copy of Ghostscript (gswin32c on Windows), which works without errors or warnings, and it won't be upgraded to newer versions, because newer versions of Ghostscript don't work with pdfsizeopt.

necros2k7 commented 4 years ago

"it won't be upgraded to newer versions, because newer versions of Ghostscript don't work with pdfsizeopt." - no plans to adopt to newer version, I see

pts commented 1 year ago

See https://github.com/pts/pdfsizeopt/issues/157 for more details about upgrading Ghostscript.