PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Fri May 16, 2025 6:22 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Feb 25, 2025 12:45 pm 
Offline

Joined: Tue Feb 25, 2025 12:27 pm
Posts: 2
We try to merge some PDFs of different sources. Some PDFs looks like they has been scanned.
The resulting PDF is broken.

Env: VB.net with .net Framework 4.8.1
PdfSharp 6.1.1 via NuGet

Source:
Code:
         Using outputDocument = New PdfDocument()
             For docCount = 0 To arListQuellpfadPdf.Count - 1
                 Using inputDocument As PdfDocument = PdfReader.Open(arListQuellpfadPdf(docCount), PdfDocumentOpenMode.Import)
                     For Each page As PdfPage In inputDocument.Pages
                         outputDocument.AddPage(page)
                     Next
                 End Using
             Next
             outputDocument.Save(zielpfadPdf)
         End Using


In the resulting PDF, the pages have a size of 0x0. We interspected the Width and Height values in the Line outputDocument.AddPage(page) and every page has Width and Height set - but they differ slightly during the different sources.

Expected
We receive a PDF file with all pages of the given files incl. all elements of the given files with the page size of the given files.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 25, 2025 12:49 pm 
Offline

Joined: Tue Feb 25, 2025 12:27 pm
Posts: 2
We try to get a scan that we're allowed to use for sharing.

Attached the file info of the source file and the same of the resulting file. (Size is for the full document)


Attachments:
File comment: Dest file info
Greenshot 2025-02-25 13.46.39.png
Greenshot 2025-02-25 13.46.39.png [ 28.81 KiB | Viewed 2353 times ]
File comment: Source File Info
Greenshot 2025-02-25 13.04.13.png
Greenshot 2025-02-25 13.04.13.png [ 33.6 KiB | Viewed 2353 times ]
Top
 Profile  
Reply with quote  
PostPosted: Thu Feb 27, 2025 11:55 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3128
Location: Cologne, Germany
There is nothing we can do without the PDF files.

If the issue persists with PDFsharp 6.2.0 Preview 3, then please make the files and the code available for investigation.

Do the problems persist when you open all PDF files in Adobe Reader and save them using "File / Save as"?
Adobe Reader can fix some anomalies of specific PDF files.

_________________
Regards
Thomas Hoevel
PDFsharp Team


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 64 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