edabg / jsprintsetup

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

html title problem #43

Closed moryekram closed 7 years ago

moryekram commented 7 years ago

Hello. I have html file that has utf-8 title. when i print using jsPrintSetup title is not valid. title should be "نامه شماره ۴۵۴/11" Please help me.Thanks. u21124iy.txt

mitkola commented 7 years ago

First try to manual print this content. jsPrintSetup doesn't modify title. I see that window.close() is called immediately after jsPrintSetup.printWindow(window). jsPrintSetup.printWindow(window) is executed asynchronously. This mean that execution of script continue after calling of method jsPrintSetup.printWindow(window) while printing may be in progress which can result in problems. The simplest way to workaroud is to call window.close() after timeout.

moryekram commented 7 years ago

Because "/" is not valid in file name in windows I remove it from my code and print it manually.my MicrosoftPrintToPDF printer change title to file path.But with jsPrintSetup title is not correct.please check this file. u21124iy.txt Thanks

mitkola commented 7 years ago

jsPrintSetup doesn't modify title implicitly. Only when you use jsPrintSetup.setOption('title', 'Some title'). You can try following:

btw. Can you post not minified code.

moryekram commented 7 years ago

Hello again.I try your suggestion but title is incorrect. here this is my file ob02auns.txt

mitkola commented 7 years ago

I have made some corrections to your example.

test.html.txt

moryekram commented 7 years ago

this is result for me. 0101 0202

mitkola commented 7 years ago

I think that this is problem of 'Microsoft Print To PDF' driver. I have tested with 'PDF Creator' and title is displayed correct. image

moryekram commented 7 years ago

OK,thanks.I test it.