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 - Open an Embedded File via Hyperlink
  FAQ FAQ  Forum Search   Register Register  Login Login

Open an Embedded File via Hyperlink

 Post Reply Post Reply
Author
Message
ashish.cppdev View Drop Down
Beginner
Beginner
Avatar

Joined: 27 Jan 20
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ashish.cppdev Quote  Post ReplyReply Direct Link To This Post Topic: Open an Embedded File via Hyperlink
    Posted: 27 Jan 20 at 3:16AM
Hi,

I just found out about Quick PDF library today and I have downloaded a trial version. So far, I am loving it, given that version 17 has Qt support as well.

My request is pretty straightforward:

1. I have a main PDF file which is a transcript.
2. Each transcript file has 1 or more exhibits.
3. These exhibits need to be attached to the transcript PDF.
4. Certain keywords in the transcript PDF need to be hyperlinked to open the associated attached (embedded) PDF exhibit file.

So far, using 
AddEmbeddedFile
AddFileAttachment

I am able to attach the exhibit files and the attached files appear as thumbtacks/pins.

Now, I would like to take care of Requirement 4 in my list above. I am not sure if it is possible with Quick PDF library but would appreciate any advice.

Thank you,
Ashish
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3079
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 20 at 11:39AM
Hi Ashish,

you can add links and you can visualize them with text but not the other way round.
Here's a sample:
https://www.debenu.com/kb/add-links-pdf-programmatically/
There's no comfortable way adding links to existing textcontent.
It's possible to extract all text - word by word with position data - and then you can create a new pdf with all the links repositioning the text.
I fear this won't look very nice ;-)

Cheers and welcome here,
Ingo

Cheers,
Ingo

Back to Top
ashish.cppdev View Drop Down
Beginner
Beginner
Avatar

Joined: 27 Jan 20
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ashish.cppdev Quote  Post ReplyReply Direct Link To This Post Posted: 27 Jan 20 at 4:21PM
Thanks Ingo. I will take your sample code and see how it turns out. I will post my results here as well.

Thanks again for the quick response.
Back to Top
ashish.cppdev View Drop Down
Beginner
Beginner
Avatar

Joined: 27 Jan 20
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ashish.cppdev Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 20 at 3:19AM
Hi Ingo,

Thanks for the link and I tried it. It does pose some challenges but I am willing to give it a shot by extracting all of the text and the box coordinates using Quick PDF.

Here is my sample code based on the example you provided a link to:

	int nEmbeddedFileId = dqpdf.AddEmbeddedFile("exhibit1.pdf","application/pdf");
        nRet = dqpdf.AddFileAttachment("Exhibit 1",nEmbeddedFileId);
        nRet = dqpdf.SetOrigin(1);
        nRet = dqpdf.AddLinkToEmbeddedFile(200, 100, 60, 20,nEmbeddedFileId,"Exhibit 1","Exhibit 1",6,50);
	    nRet = dqpdf.SetTextColor(0,0,1);
        nRet = dqpdf.SetTextUnderline(1);
        nRet = dqpdf.DrawTextW(205, 114, "Click me!");

        nRet = dqpdf.SaveToFile("dqpdf.pdf");

I can see that the file does get a Click me! text in blue color with an underline so it can look more like a link, but I have to double click it to open. Is there any way to just click once and get it to open?


Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3079
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 20 at 11:10AM
Please keep in mind that the embed-functionalities are only supported by the adobe products.
Single click actions aren't supported.
I think this would collide with functions like mark and copy?
What you can do is embed some javascript action to get the described behavior.

Cheers,
Ingo

Back to Top
ashish.cppdev View Drop Down
Beginner
Beginner
Avatar

Joined: 27 Jan 20
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ashish.cppdev Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 20 at 2:17PM
Thanks for the clarification.

When you say javascript action, can you give an example?

Thanks
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3079
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 28 Jan 20 at 6:33PM
With QuickPDF you can embed Javascript-code into your pdf and you can assign an action to it.
In the online reference and the developer guide you'll find the functionalities and samples.

The JavaScript-functionalities:
https://www.debenu.com/docs/pdf_library_reference/JavaScript.php
The types you can use:
http://www.adobe.com/devnet/acrobat/javascript.html
Open the developer guide and search with javascript:
http://www.debenu.com/docs/pdf_library_developer_guide/foxit_quick_pdf_library_15_developer_guide.pdf

The start for own searches:
https://www.debenu.com/docs/pdf_library_reference/Search.php




Edited by Ingo - 28 Jan 20 at 6:34PM
Cheers,
Ingo

Back to Top
ashish.cppdev View Drop Down
Beginner
Beginner
Avatar

Joined: 27 Jan 20
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote ashish.cppdev Quote  Post ReplyReply Direct Link To This Post Posted: 29 Jan 20 at 2:29AM
Thank you very much again! Appreciate it very much. I will start reviewing the material.
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