Rank: Newbie
Groups: Registered
Joined: 4/21/2020(UTC) Posts: 4  Location: Fort Collins
|
When looking for named destinations in a pdf using the Document.NamedDestinations.GetByName() method, it takes a long time to return if the destination cannot be found. I have a doc with thousands of destinations. If the destination is found, it returns quickly.
Is there a better way to determine if the destination exists before getting it? Using the Item[String] property is slow as well.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Try this Code:IntPtr handle = Pdfium.FPDF_GetNamedDestByName(doc.Handle, name);
if (handle == IntPtr.Zero)
//The named destination is absent.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/21/2020(UTC) Posts: 4  Location: Fort Collins
|
Thanks. That seems to do the trick. Is there a way to turn that handle into a destination. Edited by user Wednesday, April 22, 2020 6:08:39 AM(UTC)
| Reason: Not specified
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
Originally Posted by: pmilin  Is there a way to turn that handle into a destination.
Unfortunately, a suitable constructor has the Internal modifier. So only through Reflection.
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/21/2020(UTC) Posts: 4  Location: Fort Collins
|
Ok. No problem I can call the GetByName method afterward. I was just looking to optimize if possible.
|
|
|
|
|
|
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