We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to mapped the attached PDF with main PDF document using hyperlink?

How to mapped the attached PDF with main PDF document using hyperlink?

  1. Generate the PDF using Aspose. (Main.pdf)
  2. Attached 2 PDF file in main PDF. (1.pdf and 2.Pdf)
  3. We are looking some mapping open attached PDF (1.pdf or 2.pdf) from Main.pdf

Please provide solution.

Hi Melody,


Thanks for contacting support.

wajihk:
How to mapped the attached PDF with main PDF document using hyperlink? 1. Generate the PDF using Aspose. (Main.pdf) 2. Attached 2 PDF file in main PDF. (1.pdf and 2.Pdf) 3. We are looking some mapping open attached PDF (1.pdf or 2.pdf) from Main.pdf Please provide solution.

You can add FileAttachment Annotation in PDF document to open attached file(s). Please check the following code snippet to add FileAttachment Annotation into PDF document.

Document pdfDocument = new Document();<o:p></o:p>

pdfDocument.Pages.Add();

FileSpecification fs = new FileSpecification(dataDir + "attachment.pdf", "This is attachment.");

FileAttachmentAnnotation file = new FileAttachmentAnnotation(pdfDocument.Pages[1], new Aspose.Pdf.Rectangle(40, 800, 60, 820), fs);

file.Color = Color.Transparent;

file.Hyperlink = new FileHyperlink(dataDir + "attachment.pdf");

file.Contents = "This is Attachment.";

pdfDocument.Pages[1].Annotations.Add(file);

pdfDocument.Save(dataDir + "output.pdf");


You can use above code snippet to add FileAttachment Annotations which will work as hyperlinks inside the PDF document. In case of any further assistance, please feel free to contact us.


Best Regards,