Hi,
The code excerpt does not show how you used the PDPageContentStream
constructor. Many beginners use the 4-parameter constructor, but it's
the 5 parameter constructor that should be used.
Your existing PDF starts with a flip transform, and using the
4-parameter constructor will keep that flip.
Tilman
On 10.03.2025 18:48, Khelge, Abhishek wrote:
Added document and code.
Code
drawImage(signImageByteArray, document, contentStream, xCoordinate,
yCoordinate);
private void drawImage(byte[] imageByteArray, PDDocument document,
PDPageContentStream contentStream,float xCoordinate,float yCoordinate,float
width,float height)throws IOException {
// Load the image PDImageXObject signImage =
PDImageXObject.createFromByteArray(document, imageByteArray,null);
// Add the image to the PDF contentStream.drawImage(signImage,
xCoordinate, yCoordinate);
}
On 2025/03/10 08:10:32 Tilman Hausherr wrote:
> Hi,
>
> You didn't include any code. However I suspect that you are attaching
> the signature to an existing file. The PDF file from moderation had no
> signature at all. If you do that, make sure you're using the 5
parameter
> constructor of PDPageContentStream.
>
> If I'm wrong, please include the code you used.
>
> Tilman
>
> On 10.03.2025 07:07, Abhishek Khelge wrote:
> > Dear recipient,
> >
> > I am writing to report an issue I'm encountering with a specific PDF
> > file. The signature within the PDF is appearing mirrored and shifted
> > upwards. This issue has only recently arisen and was not present
> > previously.
> >
> > I am using Java with the PDFBox library in my application. I would
> > appreciate guidance on diagnosing and resolving this issue.
> >
> > PDFBox version - 2.0.26
> >
> > Thank you for your time and assistance.
> >
> > Best regards,
> > Abhishek
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
> > For additional commands, e-mail: users-h...@pdfbox.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
> For additional commands, e-mail: users-h...@pdfbox.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail:users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail:users-h...@pdfbox.apache.org