Rank: Newbie
Groups: Registered
Joined: 1/11/2023(UTC) Posts: 7
|
One of my requirements is to be able to set page labels as pages get added to my output document. Is this possible with Patagames pdfium SDK?
If the page label entry already exists (document.Root.GetBy("PageLabels") then I can see it in the dictionary, but I cannot figure out how to parse them properly. var dictionary = Document.Root; var pageLabelTreeIndirect = (PdfTypeIndirect)dictionary.GetBy(pageLabelsKey); var pageLabelTree = (PdfTypeDictionary) pageLabelTreeIndirect.Direct;
The pageLabelTree object is a dictionary that only supports strings as keys. The only key I see in the dictionary is "Nums". I did try adding an entry into the dictionary, but it doesn't seem to do anything.
var thisPagesLabelDictionary = PdfTypeDictionary.Create(); thisPagesLabelDictionary["P"] = PdfTypeString.Create("TEST PAGE"); pageLabelTree.Add("0", thisPagesLabelDictionary);
Has anyone gotten this to work? It's very straight forward with iText, but they obviously mask the complexity.
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,104
Thanks: 7 times Was thanked: 128 time(s) in 125 post(s)
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 1/11/2023(UTC) Posts: 7
|
Nice job! This seems to work as expected. Much simpler. Thank you.
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close