edabg / jsprintsetup

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

Unable to print internal iframe #4

Open jbanety opened 8 years ago

jbanety commented 8 years ago

Hi, I'm trying to print a PDF loaded in an iframe. There is my code :

var iframe = document.getElementById('pdf-iframe');
iframe.onload = function() {
    iframe.focus();                 
    jsPrintSetup.setSilentPrint(1);
    jsPrintSetup.printWindow(iframe.contentWindow);
    jsPrintSetup.setSilentPrint(0);
};
iframe.src = 'http://mydomain.com/file.pdf';

I got this error : NS_ERROR_XPC_SECURITY_MANAGER_VETO: Security Manager vetoed action arg 0 [jsPrintSetup.printWindow]"

I set correct permissions "Enable access from all sites" in extension configuration.

mitkola commented 8 years ago

Hi, The source of your frame is pdf file which probably is displayed by internal pdf viewer of FF. In this case I suppose thar frame can't be printed, because it is not DOM window. You can try to display html content in frame and print again.

Regards,

Dimitar