PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Wed Dec 17, 2025 6:42 am

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  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 23, 2012 8:55 am 
Offline

Joined: Tue Oct 23, 2012 8:44 am
Posts: 2
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 5324 times ]
structtreeroot.PNG
structtreeroot.PNG [ 6.23 KiB | Viewed 5324 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 24, 2012 7:26 am 
Offline

Joined: Tue Oct 23, 2012 8:44 am
Posts: 2
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();
}


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

All times are UTC


Who is online

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