I've a problem when I print a document (PDF,TXT,HTML,... ) through Firefox, the browser show me the next message: "Error: Cannot parse (FILE)c:/prueba3.pdf as a PDF". The same test works in IE11, Chrome...
Any suggestions?
Thank you!!
--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Clients tend to use base64 in that case and send via Ajax, etc and I suspect that to be your problem.
I don't believe this to be a QZ Tray problem but rather an access problem with the PDF.
One way to test is to open a new private/incognito browser and try to access the PDF. If the private browser can't access, neither will QZ Tray (Java runs as a separate process).
If you don't want to open up security to fix this (we don't blame you!), try to use a base64 encoder and append it that way instead.
https://qz.io/wiki/2.0-pixel-printing#base64-pdf
On May 24, 2016 8:13 AM, "Carlos Neila Ramos" <carlos.ne...@gmail.com> wrote:In the server doesn't work any example. On the other hand if I execute in my computer sample.html works.Hi Tres,Firstly thank you for your answer.
I attached the log.
2016-05-24 14:02:04,491 [ERROR] Failed to print
java.lang.UnsupportedOperationException: Cannot parse (FILE)http://localhost:8080/hphis/curso/demo/assets/prueba3.pdf as a PDF file
at qz.printer.action.PrintPDF.parseData(Unknown Source)
at qz.ws.PrintSocketClient.processPrintRequest(Unknown Source)
at qz.ws.PrintSocketClient.processMessage(Unknown Source)
at qz.ws.PrintSocketClient.onMessage(Unknown Source)
at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.eclipse.jetty.websocket.common.events.annotated.CallableMethod.call(CallableMethod.java:70)
at org.eclipse.jetty.websocket.common.events.annotated.OptionalSessionCallableMethod.call(OptionalSessionCallableMethod.java:68)
at org.eclipse.jetty.websocket.common.events.JettyAnnotatedEventDriver$2.run(JettyAnnotatedEventDriver.java:210)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.io.IOException: Error: End-of-File, expected line
at org.apache.pdfbox.pdfparser.BaseParser.readLine(BaseParser.java:1110)
at org.apache.pdfbox.pdfparser.COSParser.parseHeader(COSParser.java:1875)
at org.apache.pdfbox.pdfparser.COSParser.parsePDFHeader(COSParser.java:1846)
at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:242)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:973)
at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:875)
... 13 more