I am drawing an image on one of the PDF page.. when I use PDPageContentStream stream = new PDPageContentStream(doc, page);
to draw image, everything works fine.. see below image.
but when I use constructor PDPageContentStream(doc, page, true, true);
to create PDPageContentStream
and draw image, the newly added image gets inverted upside down..
not getting what's going wrong here..
PS. I am using library PdfBox-Android
Use the constructor that has a fifth parameter, so to reset the graphic context.
public PDPageContentStream(PDDocument document, PDPage sourcePage, boolean appendContent,
boolean compress, boolean resetContext) throws IOException
alternatively, save and restore the graphics state in the first content stream by calling
saveGraphicsState();
// ...
restoreGraphicsState();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With