% SL Script to control PDF generation, center a small input into a larger page define pdf_page_setup(pagenum) { variable delta_x; variable delta_y; variable targetpagex = 1500; % Change here your desired output size variable targetpagey = 1800; % should be larger than the input size delta_x = targetpagex - pageWidth(); delta_y = targetpagey - pageHeight(); % place only if the output size is larger than the input, otherwise do nothing if (delta_x > 0 and delta_y > 0) { setupPage(delta_x/2.0,delta_y/2.0,0,1,1,0); setMediaBox(int(targetpagex),int(targetpagey)); } }