Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - How do i create a link from an outline? C#
  FAQ FAQ  Forum Search   Register Register  Login Login

How do i create a link from an outline? C#

 Post Reply Post Reply
Author
Message
Sykh View Drop Down
Beginner
Beginner


Joined: 17 Sep 20
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sykh Quote  Post ReplyReply Direct Link To This Post Topic: How do i create a link from an outline? C#
    Posted: 22 Sep 20 at 12:24PM
Hey again,
so i created an outline on a page (easy) and it got an outline ID, i then create a named destination for that id (returns 1), try to grab the Destination ID from that name (returns 0) and then use it to add a Link which of course doesn't work.

                        linkId = this.getOutlineId(foundMarker[1]);
                        if (linkId > 0)
                        {
                            Console.WriteLine("OutlineId: " + outlineId);
                            if (qp.SetOutlineNamedDestination(linkId, foundMarker[1]) == 1)
                            {
                                Console.WriteLine("Created NamedDestination " + foundMarker[1]);
                            }
                            int destinationId = qp.GetNamedDestination(foundMarker[1]);
                            Console.WriteLine("Destiation " + foundMarker[1] + " ID: " + destinationId);
                            qp.AddLinkToDestination(x, y, width, height, destinationId, 1);
                        }
and the output is
Quote
OutlineId: 1476395014
Created NamedDestination MyPlaceholder
Destiation MyPlaceholder ID: 0

Is this even the way to do it or can i skip named and get straight to an LinkID?

Cheers
Simon


Edited by Sykh - 22 Sep 20 at 12:24PM
Back to Top
Sykh View Drop Down
Beginner
Beginner


Joined: 17 Sep 20
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote Sykh Quote  Post ReplyReply Direct Link To This Post Posted: 22 Sep 20 at 2:30PM
I have tried a different approach since i can get the page number of the outline and they are always at the beginning of a page but NewDestination is still 0

int outlinePage = qp.GetOutlinePage(outlineId);
Console.WriteLine("OutlineId: " + outlineId + " on page " + outlinePage);
int destinationId = qp.NewDestination(outlinePage, 0, 7, 0, 200, 0, 0);
Console.WriteLine("Destination " + foundMarker[1] + " ID: " + destinationId);
qp.AddLinkToDestination(x, y, width, height, destinationId, 1);

Output:
Quote
OutlineId: 1476395022 on page 14
Destiation MyPlaceholder ID: 0

So i think there is something in general i don't understand 

Cheers
Simon

Update
Turns out i can skip the destination which i can't get to work anyway, I'm using 
qp.AddLinkToPage(x, y, width, height, outlinePage, 0, 0));
now which is finally working.

Would be interesting tho what went wrong with my destinations, i might need them in the future...


Edited by Sykh - 22 Sep 20 at 3:02PM
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store