I have a Brother PT-9800PCN label printer that uses 6mm to 36mm tapes. Is there a way of changing the default paper size (width, length, orientation) via command line? I'm generating 18x113mm and 24x50mm labels in pdfs using fpdf and when sending the pdfs to the printer via php it only prints on what paper size is set as default. I've tried commands with Adobe, Foxit and Sumatra. I've also tried Verypdf pdfprint command line that has the option to set the paper size with the same outcome. Was thinking that if I change via command line the default paper size and then send the print job it should work.
After long head bashing I managed to get it working. What I've done is
->for each paper size required go into the printer preferences and set the page size, width, length and any other required settings
->in cmd run after all settings for each page size are done
rundll32 printui.dll PrintUIEntry /Ss /n "\\network\printer" /a "C:\prefered_location\temp_settings.dat" u
->for each page size I required I saved the settings as
This is the code I use in php to send my pdfs to the printer
<?php //save current printer settings to a temp file echo system("rundll32 printui.dll PrintUIEntry /Ss /n \"\\\\network\\printer\" /a \"C:\\location\\temp_settings.dat\" u"); //load the required page settings echo system("rundll32 printui.dll PrintUIEntry /Sr /n \"\\\\network\\printer\" /a \"C:\\location\\24x45mm.dat\" u"); //send pdf to printer. I've used in this case pdfprint.exe. Foxit can be used as well. Adobe didn't work. Sumatra still sends the pdf only to a 36mm tape echo system("C:\\location\\pdfprint_cmd\\pdfprint.exe -printer \"\\\\network\\printer\" C:\\location\\mypdf.pdf"); //restore temp settings echo system("rundll32 printui.dll PrintUIEntry /Sr /n \"\\\\network\\printer\" /a \"C:\\location\\temp_settings.dat\" u"); //delete temp settings file echo system("del C:\\location\\temp_settings.dat"); ?>