PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Nov 10, 2024 7:47 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Aug 28, 2023 8:28 am 
Offline

Joined: Mon Aug 28, 2023 8:09 am
Posts: 3
Hello everyone! Sorry if this is a silly question, I was not able to find an answer.

Given a specific PDF document that I have, using PDFsharp, I want to go over its bookmarks/outlines. For some of these outlines, an /A is defined. I want to get its content. However, I was unable to find it.

For example, one of the outlines is defined as follows:
Code:
7142 0 obj
<</Title <FEFF00430031>
/Count -2
/First 7143 0 R
/Last 7144 0 R
/Parent 7141 0 R
/Next 7145 0 R
/A 928 0 R
>>
endobj


Given a PdfOutline that represents this object, I can
(1) get its object id using Internals.ObjectId.
(2) get title, first, last, parent, next using the Elements dictionary.

I can't, however, manage to get the /A part. I would appreciate help with that!

(I do know that I can get 928's defined /Goto action using Element["/Dest"]. However, I am not interested in that. Ultimately, interested in the "928" value. (Since object 929 is actually what I'm after, which I currently find using document.Internals.GetObject(), but this is probably unrelated.))

Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Mon Aug 28, 2023 10:04 am 
Offline

Joined: Mon Aug 28, 2023 8:09 am
Posts: 3
I finally found this topic:
viewtopic.php?f=2&t=3663&hilit=%2FA+action

Using the
Code:
outline.Elements.GetDictionary("/First");
way of accessing the outlines got me what I wanted. Given a PdfDictionary d that represent my corresponding outline, I can get the "/A" value using
Code:
d.Elements.GetString("/A");
.

Leaving this up in case it helps someone in the future!


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: Bing [Bot], Google [Bot] and 24 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