Page 1 of 1

Convert multiple base64 images to multi page pdf

Posted: 2017-02-01T21:28:06-07:00
by mrbushido
Hi,

I have multiple base 64 image strings in a txt file. I can combine the strings into one base64 string and convert them to a pdf but it does not write each base64 image to a different pdf page, it just writes them to one really long page. Also if I try multiple base64 strings, the conversion does not work. Here's my command that works:

/usr/bin/convert inline:blob.txt -quality 100 -density 120 complete.pdf

If the "blob.txt" file contains :

data:image/png;base64,stringheredata:image/png;base64,stringhere

it does not work

Basically my goal here is to get each base64 string (image) on a different page of the pdf

Any help would be appreciated, thanks

Re: Convert multiple base64 images to multi page pdf

Posted: 2017-02-02T07:15:32-07:00
by snibgo
What happens if you have one text file per base 64 image?

Re: Convert multiple base64 images to multi page pdf

Posted: 2017-02-02T20:07:32-07:00
by mrbushido
Thanks for this, that almost worked but it just put the text straight in the pdf, I then added inline: and it put the images properly in the pdf on separate pages, the final command was:

/usr/bin/convert inline:blob0.txt inline:blob1.txt -quality 100 -density 120 complete.pdf