I need the arguments for the ghostscript in order to convert a double-up pdf page to a simple column pdf page
the input
+--------+-------+
| | |
| | |
| | |
| 1 | 2 |
| | |
| | |
+--------+--------+
the output
+-------+
| |
| 1 |
| |
| |
| |
| |
+--------+
+-------+
| |
| 2 |
| |
| |
| |
| |
+--------+
So depending on these two posts post1 and post2 I created this code
import sys
import locale
import ghostscript
args = [
"-ooutput.pdf",
"-sDEVICE=pdfwrite",
"-g2807x5950"
"-fpdfFile.pdf"
]
# arguments have to be bytes, encode them
encoding = locale.getpreferredencoding()
args = [a.encode(encoding) for a in args]
ghostscript.Ghostscript(*args)
I expeced a 2 page pdf file but a fatal error was raised
Edit: this is the error message enter image description here