pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chitgoks <chitg...@gmail.com>
Subject Re: rubberstamp annotation with base 64 image
Date Thu, 01 Jun 2017 12:13:59 GMT
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 <peter.pinnau@unterbrecher.de>
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: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message