I have pdf which have same paper size (A6) and multiple pages. What i want to do is to print 2 pages into one sheet of paper (A4) using python. Try to automate thing here which is why i use Python.
I know i can print stuff using GSPrint with Python but i never quite get how to do this with it.
import win32print
import win32api
import autoit
import os
dir_print = r'C:\Users\anom\Google Drive\Programming\test\New folder'
list_tracking = os.listdir(dir_print)
for name in list_tracking:
print('Printing - ', name)
GHOSTSCRIPT_PATH = r"C:\Users\anom\Google Drive\Programming\test\GHOSTSCRIPT\bin\gswin32.exe"
GSPRINT_PATH = r"C:\Users\anom\Google Drive\Programming\test\GSPRINT\gsprint.exe"
filename = os.path.join(dir_print, name)
win32api.ShellExecute(0, 'open', GSPRINT_PATH, '-ghostscript "'+GHOSTSCRIPT_PATH+'" -printer "RICOH SP 150SU" -color -dPDFFitPage "'+filename+'"', '.', 0)
Its got me thinking to resize the page to A4 first then print which is doable with Pypdf2 module (maybe...) But i stuck at printing 2 pages into one sheet of paper.