edabg / jsprintsetup

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

Printing blank page with Firefox 46 update and two printers #13

Open Ilastec opened 8 years ago

Ilastec commented 8 years ago

We have a PC with two printers installed. We updated jsPrintSetup to the last version to solve the printing blank page bug. In one of the printers, a POS printer, it worked OK, but in the other one, a classic A4 printer, it prints a blank page.

rabihmb commented 8 years ago

I have the exact problem, I'm using it since long time, it print blank page with FF 46

Any immediate response would be appreciated.

mitkola commented 8 years ago

Try to change printer on which to print. I suppose that there is some change in reading preferences for printer in FF. There is report that if you change printer jsPrintSetup.setPrinter() the problem is solved. https://www.mozdev.org/bugs/show_bug.cgi?id=26206#c13 Bug 26206 I did investigation for source of this problem, but without success.

Ilastec commented 8 years ago

I always use setPrinter method. As I said, when using only a POS printer, it works fine. The issue is when I try to print to another printer. I've noticed that if I set the silent print to false and force the user selecting a printer, it works fine, but with the silent print activated it prints blank page.

rabihmb commented 8 years ago

I have only one printer and still cannot print.

mitkola commented 8 years ago

You can try to call jsPrintSetup.setPaperSizeData after you select the printer and turn on DEBUG option to see any hidden errors if exists.

// ...
jsPrintSetup.setGlobalOption('DEBUG', true);
jsPrintSetup.setPrinter('My A4 Printer');
jsPrintSetup.setPaperSizeData(9); // 9 is ISO A4
// ...

On which platform/OS you are working?

rabihmb commented 8 years ago

I'm using FF 46 on W7-64bit

Ilastec commented 8 years ago

I've done what you said about the DEBUG mode and I get an error: Error: message:Component returned failure code: 0x80480007 (NS_ERROR_GFX_PRINTER_DOC_IS_BUSY) [nsIWebBrowserPrint.print] result:2152202247 name:NS_ERROR_GFX_PRINTER_DOC_IS_BUSY

mitkola commented 8 years ago

It seems that document is not fully loaded (the page is busy). https://dxr.mozilla.org/mozilla-beta/source/layout/base/nsDocumentViewer.cpp#3637

rabihmb commented 8 years ago

Look, It worked perfectly on 46 by using the following steps:

  1. go to about:preferences#sync and Disconnect Firefox Account
  2. go to Help > Troubleshooting Information and press "Give Firefox a tune up" in the right side.

try to install the JS back and it will print.

Ilastec commented 8 years ago

@rmbaba it worked like a charm!!!!

rabihmb commented 8 years ago

this is a workaround, but I hope the developer solve it SOON

Ilastec commented 8 years ago

I don't think it could be solved in any other way since this is a FF bug of misconfiguration when it's updated to the 46 version.

Luisetelo commented 8 years ago

Hi guys,

I am having the same problem. I am using FF 46.0.1 and W10 64 bits and the solution of @rmbaba worked for me indeed I skip first step and also worked. It looks like If you have already installed the plugin and then update FF to 46 it won't work. First install FF46 and then the plugin, that's what I have done.

rabihmb commented 8 years ago

For sure no need to follow the first point, but I mentioned just to remember the folk in case they are using Sync feature.

mitkola commented 8 years ago

Next fix about print blank page after FF upgrade to version 46. The main source of problem is that version 45 saves in preferenses print_resolution as negative value -437918235 (actually not used). After upgrade the value is used, but is invalid for printer driver. As result blank page is printed. This behavior is now fixed.

rabihmb commented 8 years ago

so is there anything from our side must be do it to avoid such as this problem like upgrading the jsprint or something else?

mitkola commented 8 years ago

After upgrade addon to 0.9.5.3 the fix will be applied.

rabihmb commented 8 years ago

I can confirm that when upgraded to the latest version, the problem was solved on the other PC without pressing Refresh on FF