Hello!
First of all, I want to thank you for your work and this excellent library!
I'm using PDFsharp latest version 1.50.5147 in a .Net Framework 4.8 C# application.
When merging multiple PDF files into one using the PdfDocument.AddPage method to insert pages into a PDF file and PdfDocument.Save to save it, PDFSharp changes the page format in output file.
For example, please see the attached image file Merge_Text_Format_Problem.png that demonstrate how line breaks are added to text that was not in the source file. On the left side PDF file opened with Adobe Acrobat DC (64-bit). On the right side, the text copied from the PDF file in notepad++ with "Show All Characters" option.
Is there a way to merge files without changing the page format?
I have attached a console application in an archive PDFSharpMergeConsoleApp.zip with sample code that merges PDF files "TestData\\Test_File_1.pdf" and "TestData\\Test_File_2.pdf" into the resulting "Output\\Result.pdf" You can run the application and get the result. All code is in Program.cs. The path to the resulting file is displayed in the console.
Thanks in advance for your feedback!
Attachments: |
File comment: A demonstration how line breaks are added to text that was not in the source file.
Merge_Text_Format_Problem.png [ 199.08 KiB | Viewed 11739 times ]
|
File comment: A simple console application that merges two PDF files into one.
PDFSharpMergeConsoleApp.zip [58.46 KiB]
Downloaded 829 times
|
|