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!
Open an Embedded File via Hyperlink |
Post Reply |
Author | |
ashish.cppdev
Beginner Joined: 27 Jan 20 Status: Offline Points: 6 |
Post Options
Thanks(0)
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 |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
ashish.cppdev
Beginner Joined: 27 Jan 20 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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.
|
|
ashish.cppdev
Beginner Joined: 27 Jan 20 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
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?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
ashish.cppdev
Beginner Joined: 27 Jan 20 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Thanks for the clarification.
When you say javascript action, can you give an example? Thanks
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
ashish.cppdev
Beginner Joined: 27 Jan 20 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Thank you very much again! Appreciate it very much. I will start reviewing the material.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store