Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Causes printing to suspend and firefox to hang #9

Open
Brad3273 opened this issue Mar 20, 2016 · 3 comments
Open

Causes printing to suspend and firefox to hang #9

Brad3273 opened this issue Mar 20, 2016 · 3 comments

Comments

@Brad3273
Copy link

Hello. I have been using JS Print Setup for a couple of years; it's a wonderful bit of software, thank you for writing it.

It's been working flawlessly for me with an old version of Firefox - version 24.6.0-1 - running on 64-bit Centos 6. Today I tried to move my application to 64-bit Centos 7, using the version of Firefox which comes with the distribution - Firefox 38.5.0-3.

When I use JS Print Setup with Firefox 38.5.0-3 printing 'hangs' after jsPrintSetup.print() is called if I have silent printing set. If, after running jsPRintSetup.print(), I click on the File -> Print menu Firefox will pop up an alert window saying 'Some printing functionality is not currently available'. When I try to exit Firefox with File -> Quit the window closes but the Firefox process does not terminate; I have to kill it.

This happens with the code you give as a sample on your Wiki page, and also with the code that I've been using with no problems with the older version of Firefox, a simplified example of which is below:

function doprint () {
        var jsprint_filename = '/tmp/print.pdf';
        var jsprint_header = 'my header';

        jsPrintSetup.setPrinter('PostScript/default');

        jsPrintSetup.setOption('outputFormat', jsPrintSetup.kOutputFormatPDF);
        jsPrintSetup.setOption('toFileName', jsprint_filename);

        jsPrintSetup.setOption('orientation', jsPrintSetup.kPortraitOrientation);

        jsPrintSetup.setOption('headerStrLeft', jsprint_header);
        jsPrintSetup.setOption('headerStrCenter', '');
        jsPrintSetup.setOption('headerStrRight', '&PT');

        jsPrintSetup.setOption('footerStrLeft', '');
        jsPrintSetup.setOption('footerStrCenter', '');
        jsPrintSetup.setOption('footerStrRight', '');

        jsPrintSetup.clearSilentPrint();
        jsPrintSetup.setOption('printSilent', 1);

        jsPrintSetup.print();

        jsPrintSetup.setOption('printSilent', 0);
}

I upgraded to the latest version of Firefox in the Centos 7 repository, version 38.7.0, but the problem is still there.

I haven't tried the latest version 45.0.1 of Firefox straight from Mozilla; instead I downgraded and installed my old version 24.6.0 of Firefox, which works perfectly with the very same code.

I used the same version of JS Print Setup with all the different versions of Firefox - version 0.9.5.1.

Can you tell me what versions of Firefox you have tested with JS Print Setup? And if you might fix it to work with the modern versions?

Thanks!

@mitkola
Copy link
Contributor

mitkola commented Mar 24, 2016

Hi,
jsPrintSetup was tested and work to the latest stable version of Firefox 45.0.1 (Windows).

I think that there is general printing problem of Firefox in your environment.
You have to be sure that can do manual printing from Firefox before use jsPrintSetup.
jsPrintSetup is pure JavaScript extension and uses Firefox print interfaces at higher level and hanging process without possibility of exiting is out of scope of extension.

Regards,

Dimitar Angelov

@Brad3273
Copy link
Author

Hello,

I think that there is general printing problem of Firefox in your environment.
You have to be sure that can do manual printing from Firefox before use jsPrintSetup.

Yes, I did that. Before running the Javascript function using jsPrintSetup I would click on File -> Print and do a test print using the 'print to file' and PDF format. It worked fine. Then I would load the local page which would run the javascript function, which in turn would call jsPrintSetup and then hang Firefox as I have described.

jsPrintSetup was tested and work to the latest stable version of Firefox 45.0.1 (Windows).

I'll keep running for now on the old version 24.6.0 of Firefox. If/when I next need to upgrade I'll install the latest stable version of Firefox, regardless of which version is current in my Centos 7 Linux distribution.

Thanks for your reply.

@nickls
Copy link

nickls commented Apr 29, 2016

I found this issue while trying to figure out if other people were effected by this issue or just me.

I filed a bug in firefox core:
https://bugzilla.mozilla.org/show_bug.cgi?id=1266274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants