Hi I have a PDF that has been generated with the latest EO-PDF version (25.1.22) with GenerateTags=true.
I then open the PDF in Acrobat Reader and it is marked Tagged=Yes - all is OK - I can also open this file in PAC (PDF Accessibility Checker -
https://pac.pdf-accessibility.org/en)
I then use the same code and add the following code after the generation...
Code: C#
EO.Pdf.PdfDocument doc = null;
MemoryStream stream = null;
using (stream = new MemoryStream())
{
stream.Write(pdfResult, 0, pdfResult.Length); //pdfResult is the byte[] containing the original (generated) PDF that was OK
stream.Seek(0, SeekOrigin.Begin);
doc = new EO.Pdf.PdfDocument(stream);
doc.Info.Title = "My title";
doc.Language = "eng";
doc.Save(stream);
}
pdfResult = stream.ToArray();
...I then open the PDF in Acrobat Reader and I get a message that appears in a dialog box for a fraction of a second (you may miss this) saying "
File is corrupted but is being repaired" - the file is viewable in Acrobat Reader and is marked Tagged=Yes - when I close the file I get a dialog asking to Save the file (as it has been repaired/modified by Acrobat Reader) - if I save this file, it (the saved file) opens fine in PAC - if I *don't* save, it (the unsaved file) does *not* open in PAC - I get a message saying "
The PDF document is corrupted and unfortunately it can't be read by PAC (Cross reference section not found at offset: 99537)". Note that both the saved and unsaved PDF files open without an issue in Chrome, Edge, FF. Also note the saved file was dramatically smaller than the unsaved file.
I seem to have similar issues when modifying post-generation (merging, adding footers, etc) existing tagged documents - is there something I am doing wrong here ?