PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

StructTreeRoot which is PDF/A compliant (Also MarkInfo)
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2175
Page 1 of 1

Author:  JensN [ Tue Oct 23, 2012 8:55 am ]
Post subject:  StructTreeRoot which is PDF/A compliant (Also MarkInfo)

Hello,

I know PDF/A isn't supported oficially yet. However I'm trying to implement it in my project with PdfSharp.
One criteria I have to comply is the StructTreeRoot in the PDF file.

I tried a few things to add this TreeRoot. But nothing worked out.
This: "http://www.pdfsharp.com/PDFsharp/index.php?option=com_content&task=view&id=33&Itemid=44" adds the RootNode visually in the PDF file. But it isn't compliant to PDF/A.

Does anyone know a method to implement the StructTreeRoot with PDF/a compliance?

I think the MarkInfo Entry is almost the same procedure to implement as the StructTreeRoot. So does anyone know more about this?

Regards
Jens

(I added the criteria from Preflight as a picture)

Attachments:
markinfo.PNG
markinfo.PNG [ 2.05 KiB | Viewed 5325 times ]
structtreeroot.PNG
structtreeroot.PNG [ 6.23 KiB | Viewed 5325 times ]

Author:  JensN [ Wed Oct 24, 2012 7:26 am ]
Post subject:  Re: StructTreeRoot which is PDF/A compliant (Also MarkInfo)

I found a way to add the StructTreeRoot and the MarkInfo entry with PDF/A compliance (C#):

Code:


private void createPDF(){
                PdfDocument document = new PdfDocument();

                PdfDictionary structureTreeRoot = new PdfDictionary(document);
                structureTreeRoot.Elements["/StructElem"] = new PdfName("/Bla"); //The entry must exist, no matter which term is in there (source: Adobe Preflight)
                PdfArray array = new PdfArray(document);
                document.Internals.AddObject(structureTreeRoot);
                document.Internals.Catalog.Elements["/StructTreeRoot"] =                  PdfInternals.GetReference(structureTreeRoot);
                PdfDocument document = new PdfDocument();
}

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