Open rudiultra opened 6 years ago
Can you post sample code to reproduce?
HI Dimitar!
Here my sample:
jsPrintSetup.setOption( 'printToFile', 1 )
jsPrintSetup.setOption( 'outputFormat', 'kOutputFormatPDF' )
jsPrintSetup.setOption( 'toFileName', 'c:\\Downloads\\xy.pdf' ) // or '/home/xy/Download/xy.pdf'
jsPrintSetup.setSilentPrint(true)
jsPrintSetup.print()
jsPrintSetup.setSilentPrint(false)
Servus from Vienna
Sorry for this line: jsPrintSetup.setOption( 'printToFile', 1 ) jsPrintSetup.setOption( 'outputFormat', jsPrintSetup.kOutputFormatPDF ) // correct statement jsPrintSetup.setOption( 'toFileName', 'c:\Downloads\xy.pdf' ) // or '/home/xy/Download/xy.pdf' jsPrintSetup.setSilentPrint(true) jsPrintSetup.print() jsPrintSetup.setSilentPrint(false)
HI Dimitar! Here my sample: jsPrintSetup.setOption( 'printToFile', 1 ) jsPrintSetup.setOption( 'outputFormat', 'kOutputFormatPDF' ) jsPrintSetup.setOption( 'toFileName', 'c:\Downloads\xy.pdf' ) // or '/home/xy/Download/xy.pdf' jsPrintSetup.setSilentPrint(true) jsPrintSetup.print() jsPrintSetup.setSilentPrint(false)
Servus from Vienna
Dimitar Angelov <notifications@github.com> schrieb am 14:50 Montag, 14.August 2017:
Can you post sample code to reproduce?— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.
I have tested this code on Windows 10, FF 54.0.1 32-bit and works fine. Try on fresh firefox install without other addons.
function test() {
// jsPrintSetup.setGlobalOption('DEBUG', true);
jsPrintSetup.setOption( 'printToFile', 1 );
jsPrintSetup.setOption( 'outputFormat', jsPrintSetup.kOutputFormatPDF );
jsPrintSetup.setOption( 'toFileName', 'd:\\Temp\\xy.pdf' );
jsPrintSetup.setSilentPrint(true)
jsPrintSetup.print()
jsPrintSetup.setSilentPrint(false)
}
I am using the 'toFileName' option and silent printing.
Environtment 1) Linux: Ubuntu 16.04 Firrefox: 54.0 64bit Works fine.
Environtment 2) Windows: W10 Firrefox: 47.0.2 32-bit and 54.0.1 32 bit Problem: A dialog for the file name pops up.