0

I'm not able to print a base64 encoded image with GCP.

This is what I'm using :

var data = "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEBLAEsAAD//gBERmlsZSBzb3VyY ....";

var gadget = new cloudprint.Gadget();
gadget.setPrintButton(cloudprint.Gadget.createDefaultPrintButton("gcpPrint"));
gadget.setPrintDocument("image/jpeg", "JPG Image", data, "base64");
gadget.openPrintDialog();

As mentioned in the docs. But GCP could not read data. Any ideas?

rohan sethi
  • 368
  • 3
  • 6
  • 14

1 Answers1

1

Need to remove :

data:image/jpeg;base64,

from the base64 string.

rohan sethi
  • 368
  • 3
  • 6
  • 14