Ghostscript merge in pdf format causes flip orientation

Ghostscript merge in pdf format causes flip targeting

I use a similar method like this SO question: How to merge two postscript files together?

In a combined PDF, each page of the page is turned upside down. I have not seen this symptom mentioned anywhere else. The merger of one hard pdf still has an upside down orientation.

@echo off REM FILE: merge.bat call :merge 1 155 out.pdf pause goto :eof REM MERGE PDFs REM @param # of first file in sequence REM @param # of last file in sequence REM @param new file of merged pdf goto :eof :merge SET START=%1 SET END=%2 SET OUT=%3 echo START=%START% echo END=%END% echo OUT=%OUT% echo. SET CMD="c:\Program Files\gs\gs9.01\bin\gswin32c.exe" SET INPUT_DIR=c:\input SET CMD_ARGS=args.bat echo Generating args file... (echo.|set /p="-dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=%OUT% ") > %CMD_ARGS% for /L %%G IN (%START%,1,%END%) do ( (echo.|set /p=" "%INPUT_DIR%\%%G.pdf" ") >> %CMD_ARGS% ) echo. >> %CMD_ARGS% del %OUT% if exist %OUT% goto :error echo Executing command... %CMD% @%CMD_ARGS% del %CMD_ARGS% echo Done. if not exist %OUT% goto :error goto :eof :error echo Error processing command. goto :eof 
+4
source share
1 answer

TJR, you can try playing with adding one of the following command line options to your Ghostscript call:

 -dAutoRotatePages=/None -dAutoRotatePages=/All -dAutoRotatePages=/PageByPage 

If this does not change the result, try this instead:

 gswin32c.exe ^ -oc:/path/to/output.pdf ^ -sDEVICE=pdfwrite ^ -dPDFSettings=/prepress ^ -dAutoRotatePages=/None ^ -c "<</Orientation 0>> setpagedevice" ^ -f /path/to/first.pdf ^ /path/to/second.pdf ^ /path/to/third.pdf 

The /Orientation 0 should turn all pages into a portrait. Using 3 should make it landscape ( 1 for a seascape, 2 for an inverted part).

However, this will not work reliably, because (some of) your source files may contain strange settings for page orientation and rotation. In this case, only "repair" of the source files will be able to fix this one by one ....

+6
source

All Articles