edabg / jsprintsetup

JSPrintSetup Firefox addon
Mozilla Public License 2.0
76 stars 39 forks source link

jsPrintSetup.setOption( 'toFileName', 'xy.pdf' ) not working in W10 #48

Open rudiultra opened 6 years ago

rudiultra commented 6 years ago

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.

mitkola commented 6 years ago

Can you post sample code to reproduce?

rudiultra commented 6 years ago

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

rudiultra commented 6 years ago

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)

rudiultra commented 6 years ago

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.

mitkola commented 6 years ago

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)
}