qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

Base64 PDF Bug #141

Closed tresf closed 8 years ago

tresf commented 8 years ago

@bberenz since we're moving away from the data:application/pdf;base64,JVBERi0xLjMKJcfsj6...== syntax, I think now we're missing the base64 functionality...

var config = qz.configs.create("My Printer");
var data = [{
   type: 'pdf',
   format: 'base64',
   data: 'JVBERi0xLjMKJcfsj6...=='}];
qz.print(config, data);

Throws:

ERROR] 2016-01-18 09:29:17,348 @ qz.ws.PrintSocketClient:439
    Failed to print
java.lang.UnsupportedOperationException: Cannot parse (base64)JVBERi0xLjMKJcfsj6IKNSAwIG9iago8PC9MZW5nd...

My instinct is we'll need to add something like this to PrintPDF.java:

pdfs.add(PDDocument.load(Base64.decode(data.getString("data"))));
akberenz commented 8 years ago

Fixed via 9e3942a15f55cb7a2ac85f061798c7a23b1a8cd0