You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My pdf document is returned but with two problems: Orientation is incorrect (it's set to Portrait when it's actually Landscape) and the Height is a negative value.
This is fine if I just return the document to the user as the PDF is readable. The problem is when I try to create the XGraphics as I'm doing it as follows:
This method doesn't accept negative values for the dimensions and therefore throws an exception. If I do Abs on the Height value, then it allows me to do the watermarking but the original pdf content doesn't show up anymore and I can only see the watermark.
Can somebody help with this issue?
Adding up some details about this particular pdf:
The text was updated successfully, but these errors were encountered:
es-tomas
changed the title
Stream has negative height
Watermark Stream with negative height
Dec 20, 2023
Hi,
I'm working on a watermarking of a document and I've got a
stream
as an input. I try to open it doing the following:PdfDocument document = PdfReader.Open(stream, PdfDocumentOpenMode.Modify);
My pdf document is returned but with two problems: Orientation is incorrect (it's set to Portrait when it's actually Landscape) and the Height is a negative value.
This is fine if I just return the document to the user as the PDF is readable. The problem is when I try to create the
XGraphics
as I'm doing it as follows:XGraphics gfx = XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Append);
This method doesn't accept negative values for the dimensions and therefore throws an exception. If I do
Abs
on the Height value, then it allows me to do the watermarking but the original pdf content doesn't show up anymore and I can only see the watermark.Can somebody help with this issue?
Adding up some details about this particular pdf:
The text was updated successfully, but these errors were encountered: