PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Sep 27, 2022 5:08 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Jul 25, 2022 10:56 am 
Offline

Joined: Mon Jul 25, 2022 10:32 am
Posts: 2
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
Merge_Text_Format_Problem.png [ 199.08 KiB | Viewed 303 times ]
File comment: A simple console application that merges two PDF files into one.
PDFSharpMergeConsoleApp.zip [58.46 KiB]
Downloaded 22 times
Top
 Profile  
Reply with quote  
PostPosted: Thu Aug 04, 2022 9:00 am 
Offline

Joined: Mon Jul 25, 2022 10:32 am
Posts: 2
Hello!

Are there any updates to the question above?

Best regards,
Vitaly Kvashin


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 50 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group