-
Notifications
You must be signed in to change notification settings - Fork 283
Closed
Labels
bugdocument-editingRelated to creating or editing/modifying documentsRelated to creating or editing/modifying documents
Description
I have an application that uses PdfPig to merge multiple PDF files. I'm using PdfDocumentBuilder.AddPage
for this.
The users of the application have reported a few cases where the created (merged) PDF has missing elements (mostly annotations).
Depending on the PDF viewer application the elements are either:
- Completely missing (e.g. in Acrobat Reader)
- Visible, but rotated (e.g. in Wondershare PDFelement, Google Chrome and Microsoft Edge)
- Correctly shown (e.g. in Mozilla Firefox)
Sample input file: Input.pdf
Sample code:
string inputFile = @"C:\Data\Input.pdf";
string outputFile = @"C:\Data\Output.pdf";
using var targetStream = File.Open(outputFile, FileMode.Create, FileAccess.Write);
using var outputDocument = new PdfDocumentBuilder(targetStream);
using var inputDocument = PdfDocument.Open(inputFile);
for (int i = 1; i <= inputDocument.NumberOfPages; i++)
{
outputDocument.AddPage(inputDocument, i);
}
I've tested multiple versions of PdfPig and here are the results:
- 0.1.8: Created PDF looks correct
- 0.1.9-alpha-20240219-c2536: Created PDF is broken
- 0.1.9-alpha-20240312-845e3: Created PDF is broken
- 0.1.9-alpha-20240721-a99c0 (current version): Created PDF is broken
Metadata
Metadata
Assignees
Labels
bugdocument-editingRelated to creating or editing/modifying documentsRelated to creating or editing/modifying documents