Hi Peter
PDImageXObject imageSig = LosslessFactory.createFromImage(pdfDocument,
ImageIO.read(new
ByteArrayInputStream(DatatypeConverter.parseBase64Binary(base64Png))));
works if base64 string is png..
but it does not work if the base 64 is an svg.
data:image/svg+xml;base64,PHN2ZyB4bW......
is this a limitation?
please advise
mark
Website/Java Games: http://www.chitgoks.com
My Blogs:
http://tech.chitgoks.com
http://wuhtevah.chitgoks.com
http://disneyusa.blogspot.com
On Thu, Jun 1, 2017 at 8:08 PM, Peter Pinnau <[email protected]>
wrote:
> Hallo
>
>> but the sample shows loading it from a file.
>>
>> im looking to create a BufferedImage from a base64 svg string. has anybody
>> tried this?
>>
> I think you can create a PDImageXObject object from a BufferedImage using
>
> org.apache.pdfbox.pdmodel.graphics.image.JPEGFactory factory
>
> JPEGFactory.createFromImage( PDDocument, BufferedImage , float quality,
> int resolution);
>
>
> --
> Viele Grüße
> Peter Pinnau
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>