Am 06.06.2017 um 12:14 schrieb chitgoks:
Okay. it seems that constructor does not work
That is because the PDPixelMap(PDStream) constructor assumes a stream
like in a PDF. So that constructor is only used when opening PDFs. A
"stream" is the actual pixel sequence, possibly compressed with one or
more PDF filters (and there is no "png" filter).
That's why in the example I mentioned, there's this code:
BufferedImage awtImage = ImageIO.read(new File(imageFilename));
ximage = new PDPixelMap(document, awtImage);
Tilman
but the other constructor where you pass a BufferedImage object instead of
stream did the trick by using
ImageIO.read(new ByteArrayInputStream(byteArray))
On Tue, Jun 6, 2017 at 4:48 PM, chitgoks <[email protected]> wrote:
hi tilman ok thank you
looks like some limitation for PDPixelMap probably
i did a conversion from svg to png and the byte array output results in
blank when pdf is generated.
PDXObjectImage imageSig = new PDPixelMap(new PDStream(pdfDocument, new
ByteArrayInputStream(byteArray)));
the byte array is correct since it gets outputted correctly in java pdfbox
2+
On Tue, Jun 6, 2017 at 2:22 PM, Tilman Hausherr <[email protected]>
wrote:
Am 06.06.2017 um 01:47 schrieb chitgoks:
hi
has anyone used the .net version of pdfbox 1.8.9?
would like to ask about creating a rubber stamp how you did it
because the .net version relies heavily still on java classes and in this
case, it needs a bufferedimage and i have no idea how to do this. if this
was 2.0+ it would have been no problem, i was able to use LosslessFactory
to get a BufferedImage
thanks
The class similar to LosslessFactory in 1.8 is PDPixelMap.
There is a RubberStampWithImage.java example in the source code download.
Tilman
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]