How can I convert an A3 pdf to A4 pdf in python. I need a way that can be applied in all platforms-Windows, Mac and Linux. So something like this maybe:
import os
os.system(' command to convert A3 to A4 pdf ')
So far I found many ways to do it in Linux from here: Need to Programmatically Convert PDF Paper Size (e.g. US-Letter to A4) in Python (or command line)
I think it can be done via ImageMagick also(http://www.imagemagick.org/script/command-line-options.php#page) but I am not sure how to implement it correctly. I tried:
pdf_folder = os.listdir(infolder)
pdf_files = [_ for _ in pdf_folder if _[-4:] == ".pdf"]
print("Available PDFs:\n")
for pdffile in pdf_files:
print(pdffile)
convert -page a4 pdffile pdffile
But this gives a invalid syntax error