PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

PDFSharp change text format after merge PDF files
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4358
Page 1 of 1

Author:  VitalyKvashin [ Mon Jul 25, 2022 10:56 am ]
Post subject:  PDFSharp change text format after merge PDF files

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 699 times ]
File comment: A simple console application that merges two PDF files into one.
PDFSharpMergeConsoleApp.zip [58.46 KiB]
Downloaded 40 times

Author:  VitalyKvashin [ Thu Aug 04, 2022 9:00 am ]
Post subject:  Re: PDFSharp change text format after merge PDF files

Hello!

Are there any updates to the question above?

Best regards,
Vitaly Kvashin

Author:  VitalyKvashin [ Tue Oct 11, 2022 7:22 am ]
Post subject:  Re: PDFSharp change text format after merge PDF files

Dear PDFsharp team,

Any updates on this topic?
It is still relevant..

Best regards,
Vitaly Kvashin

Author:  TH-Soft [ Tue Oct 11, 2022 11:37 am ]
Post subject:  Re: PDFSharp change text format after merge PDF files

Hi, Vitaly,

I'm sorry, but I didn't yet find the time to debug your issue.
We're currently working on PDFsharp and I should be able to investigate this issue in this month.

Author:  VitalyKvashin [ Mon Nov 21, 2022 11:03 am ]
Post subject:  Re: PDFSharp change text format after merge PDF files

Hi Thomas,

Did you have some time to debug this issue? Any updates on this one?

Best regards,
Vitaly Kvashin

Author:  TH-Soft [ Tue Nov 22, 2022 9:42 am ]
Post subject:  Re: PDFSharp change text format after merge PDF files

Hi, Vitaly,
I can replicate the behaviour, but it still needs more research.

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