Strange problem with ghostscript and pdf files

am using ghostscript to create a pdf file from a postscript file. My PS file has no orientation instructions, so when I want to create a landscape pdf file, I use ghostscript to rotate the page. The problem is that ghostscript only rotates the first page, and when my PDF file is more than 1 page, others do not rotate correctly. Here is the command I'm using:

cat $psinput | gs -sPAPERSIZE=a4 -sDEVICE=pdfwrite -sOuputFile="/tmp/pdf" \
        -dAutoRotatePages="/None" -c "<< /Orientation 3 >> setpagedevice" \
        90 rotate 0 -595 translate -dNOPAUSE -dEPSCrop  -f - -c -quit

Does anyone have an idea how to fix this?

+3
source share
2 answers

$psinput, . $psinput, stdin Ghostscript, PS... .

  • -dOrient1=true
  • -dOrient1=false

? , , 90 rotate 0 -595 translate , -c, (-f -) :

  • -c "<</Orientation 3>> setpagedevice 90 rotate 0 -595 translate" -f - -c quit

  • -c ".setpdfwrite <<//AutoRotatePages /PageByPage>> setdistillerparams"
  • -c ".setpdfwrite <<//AutoRotatePages /All>> setdistillerparams"
  • -c ".setpdfwrite <<//AutoRotatePages /None>> setdistillerparams"

( )?

+3

ghostscript , , , pdftk impose .

0

Source: https://habr.com/ru/post/1732037/


All Articles