ststeiger / PdfSharpCore

Port of the PdfSharp library to .NET Core - largely removed GDI+ (only missing GetFontData - which can be replaced with freetype2)
Other
1.08k stars 237 forks source link

KeyType.NumberTree: Not emplemented. #358

Open gtmorrell opened 1 year ago

gtmorrell commented 1 year ago

I am needing to create Page Labels for a document. It appears that I need to create a numbertree object to hold an array of dictionaries which correspond to the actual pages and add it to the document.catalog as a PageLabels key. KeysMeta.cs has the following.

                case KeyType.NumberTree:
                    throw new NotImplementedException("KeyType.NumberTree");

Are you going to implement this? If not, is it something I could try and contribute if I can get it resolved?

Thanks for providing PDGSharpCore as open source. It is a great product.

ststeiger commented 1 year ago

Sure, send me a pull-request with your contribution, and I'll merge it. Just, please, if you want me to merge it:

gtmorrell commented 1 year ago

I spent some time looking at the opensource code trying to figure out to implement a numbertree dictionary. In doing so, I realized that I could get the result I needed by creating a PDFLiteral obj with the text string being what a numbertree would produce. I saved it as it to the catalog.items as a /PageLabels Key. It works so I wont need a numbertree at this point. I wish I understood the code better because I would like to contribute. I was just a little overwhelmed. Thank you for your help.