PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Jul 15, 2024 11:54 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Jul 10, 2024 7:37 pm 
Offline

Joined: Wed Jul 10, 2024 6:59 pm
Posts: 1
Hi,
Using PDFSharp Nuget package, v 6.1.0, windows targeting .net 4.7.2

I have the code working to merge multiple PDF's together, but the accessibility tags that were present on the source PDF's no longer exist once it's merged. I noticed that when I tried pulling in a single document using PdfDocumentOpenMode.Modify, editing it individually, and then saving it off, the tags were still present in the output document, so seems specific to the merging code or Import mode.

Is there a way to merge PDF's together using either PDFSharp or MigraDoc while keeping the accessibility tags from the original documents intact?

Code:
  //Each of the source documents are loaded from a byte array
 var inFiles = new List<PdfDocument>(inputPDFs.Count);
 foreach (var sourceBytes in inputPDFs)
 {
     stream = new MemoryStream(sourceBytes);
     inFiles.Add(PdfReader.Open(stream, PdfDocumentOpenMode.Import));
 }

 // Then I loop through the source files and copy to the new doc
 var document = new PdfDocument();
 inFiles.ForEach(
           pdfDocument =>
           {
               int count = pdfDocument.PageCount;
               for (int idx = 0; idx < count; idx++)
               {
                   PdfPage page = pdfDocument.Pages[idx];
                   document.AddPage(page);
               }
           });


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 28 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