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.