PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

existing PDF (not by PDFsharp) corrupted during modification
https://forum.pdfsharp.net/viewtopic.php?f=3&t=1233
Page 1 of 1

Author:  McByte [ Fri Jun 25, 2010 3:29 pm ]
Post subject:  existing PDF (not by PDFsharp) corrupted during modification

Hello,

The attached PDF file (not generated by PDFsharp) becomes corrupted by simply opening it, creating an XGraphics object on all pages and saving it as a new file.
Code:
PdfDocument PdfDoc = PdfReader.Open(...);
...
XGraphics.FromPdfPage(page, XGraphicsPdfPageOptions.Append);
...
gfx.Dispose();
PdfDoc.Save(...);

Attachment:
test-file.zip [213.56 KiB]
Downloaded 526 times

When loading the new file into adobe, this error appears:

An Error exists on this page. Acrobat may not display the page correctly. Please...

In addition, the exported file is much smaller than the original one.

I do not want to modify the existing content, I just want to print a watermark on it.
Is there another way to do that?

Thanks!

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/