printing PDF document directly to a specific printer using Firefox internal PDF viewer (PDF Javascript statements)
Hi, I need printing a PDF document directly to a specific printer bypassing the printing dialog. In order to do it I enclosed some JavaScript code within the PDF document (see below).
This is working when using the Adobe Reader Firefox plugin (which has been dismissed in the lastest versions of FireFox).
I tried to use the embedded Firefox PDF viewer and everything is working fine except for the printer selection. In other words the printing dialog box does not appear (I had to change some configuration in about:config) but the PDF gets always printed to the default printer, thus ignoring the JavaScript statement below "pp.printerName").
Any hint to solve my issue ?
Thanks, Alberto
%PDF-1.4 %âãÏÓ 1 0 obj <</S/JavaScript/JS(var pp = this.getPrintParams\(\);)>> endobj 2 0 obj <</S/JavaScript/JS(pp.NumCopies = 1;)>> endobj 3 0 obj <</S/JavaScript/JS(pp.interactive = 2;)>> endobj 4 0 obj <</S/JavaScript/JS(pp.pageHandling = 3;)>> endobj 5 0 obj <</S/JavaScript/JS(pp.printerName = 'SAMPLEPRINTER';)>> endobj 6 0 obj <</S/JavaScript/JS(this.print\(pp\);)>> endobj 7 0 obj <</Names[(0000000000000000) 1 0 R(0000000000000001) 2 0 R(0000000000000002) 3 0 R(0000000000000003) 4 0 R(0000000000000004) 5 0 R(0000000000000005) 6 0 R]>> endobj 8 0 obj <</Type/Metadata/Subtype/XML/Length 2952>>stream <x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:RDF rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:format>application/pdf</dc:format>
... ... ...
All Replies (1)
Try to ask advice at the Stack Overflow forum site.