Set annotation link target to PDF attachment

Discussions about PDF management.
Post Reply
Halla602
Posts: 8
Joined: Wed Jan 02, 2013 4:59 pm

Set annotation link target to PDF attachment

Post by Halla602 » Tue Oct 29, 2013 5:37 pm

Hi, I am unable to solve this C# problem with annotation and attachment.

I currently have a file that was generated elsewhere from HTML into PDF, which I am editing using GDPicutre.
I save the files that were referenced in HTML localy and then I embed into PDF.
My problem is, the original HTMl links are (in the newly created PDF file) converted to annotations.
By using this code, I am able to read the ActionURI (which is set to local files by my other HTML -> PDF SDK when the conversion from HTML link to local files occurs) using this code:

Code: Select all

 string[] Files = Directory.GetFiles(Temp_Attachements_Dir);
 for (int i = 0; i < Files.Length; i++)
 {
   Output_PDF.EmbedFile(Files[i], Path.GetFileName(Files[i]), "");              
 }
 count = Output_PDF.GetAnnotationCount();
 for (int i = 0; i < count; i++)
 {
   Output_PDF.GetActionURI(Output_PDF.GetAnnotationActionID(i));
 }
The last call returns value, whic points at the local file, such as "C:\Windows\Temp\Local_Attachment.jpg" -> which is the same file, that I embed in the for{} cycle before.

Is there any way to change this Annotation to point at the file I embeded into PDF and not at the local file, so when I click the link in the PDF (opened in acrobat for example), it opens the attachment / opens the attachment tab ?
I attached a sample PDF file showing my problem (it references local paths, but also has the same files as attachments).
Attachments
image-and-text-attachments.zip
(44.69 KiB) Downloaded 375 times

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Set annotation link target to PDF attachment

Post by Gabriela » Wed Jan 30, 2019 8:58 pm

Hi,

the second example here shows you the approach that can be useful:
https://www.gdpicture.com/guides/gdpicture/web ... ument.html

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests