Open h0jeZvgoxFepBQ2C opened 7 years ago
Hi,
This is my code, and it's always selecting A4 in the print dialoge...
jsPrintSetup.setShowPrintProgress(0); jsPrintSetup.clearSilentPrint(); jsPrintSetup.setOption('printSilent', 0); jsPrintSetup.setOption('orientation', jsPrintSetup.kPortraitOrientation); jsPrintSetup.setOption('shrinkToFit', '1'); // Reduce margins jsPrintSetup.setOption('unwriteableMarginTop', 10); jsPrintSetup.setOption('unwriteableMarginLeft', 0); jsPrintSetup.setOption('unwriteableMarginBottom', 0); jsPrintSetup.setOption('unwriteableMarginRight', 0); jsPrintSetup.setOption('marginTop',0); jsPrintSetup.setOption('marginBottom',0); jsPrintSetup.setOption('marginLeft',0); jsPrintSetup.setOption('marginRight',0); // Empty headers & footers jsPrintSetup.setOption('headerStrLeft', ''); jsPrintSetup.setOption('headerStrCenter', ''); jsPrintSetup.setOption('headerStrRight', ''); jsPrintSetup.setOption('footerStrLeft', ''); jsPrintSetup.setOption('footerStrCenter', ''); jsPrintSetup.setOption('footerStrRight', ''); //jsPrintSetup.definePaperSize(123, 123, 'FLAVE', 'FLAVE', 'FLAVE', #{(@print_setting.document_width * 100).round} , #{(@print_setting.document_height * 100).round }, jsPrintSetup.kPaperSizeMillimeters); jsPrintSetup.setPaperSizeData(2); jsPrintSetup.saveOptions(jsPrintSetup.kSaveAll); jsPrintSetup.saveGlobalOptions(jsPrintSetup.kSaveAll); jsPrintSetup.print();
At first I tried to create my own paper size data, but it didn't work - always A4 is selected. But also the other (already existing) paper formats are not selected if I provide them via the setPaperSizeData method...
Any hints? Thanks!
Hi,
This is my code, and it's always selecting A4 in the print dialoge...
At first I tried to create my own paper size data, but it didn't work - always A4 is selected. But also the other (already existing) paper formats are not selected if I provide them via the setPaperSizeData method...
Any hints? Thanks!