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

Free Support Forum - aspose.com

Concatenating files- updating linkannotations not working

After concatenating two pdf files, the annotation links no longer work. I've tried updating the linkannotation.action as per your documentation, but the link does not work in the resulting file. I've attached the test files that I'm using and this is the code I've been working with. Can you tell me what I'm doing wrong? Thanks.

string inFile1 = "file1.pdf";

string inFile2 = "file2.pdf";

string outFile = "MergedFile.pdf";

FileStream fs1 = new FileStream(inFile1, System.IO.FileMode.Open);

FileStream fs2 = new FileStream(inFile2, System.IO.FileMode.Open);

FileStream OutFile = new FileStream(outFile, FileMode.Create);

PdfFileEditor editor = new PdfFileEditor();

editor.Concatenate(fs1, fs2, OutFile);

fs1.Close();

fs2.Close();

OutFile.Close();

FileStream MergedFS = new FileStream(outFile, FileMode.Open, FileAccess.ReadWrite);

Document pdfDocument = new Document(MergedFS);

Page DestPage = pdfDocument.Pages[1];

GoToAction newAction = new GoToAction(DestPage);

XYZExplicitDestination newDest = new Aspose.Pdf.InteractiveFeatures.XYZExplicitDestination(DestPage, 1, 1, 1);

newAction.Destination = newDest;

//loop through all the annotations - set the GoToAction to a link to the first page

foreach( Page p in pdfDocument.Pages)

{

foreach (LinkAnnotation annotation in p.Annotations)

{

annotation.Action = newAction;

}

}

pdfDocument.Save("MergedFileModified.pdf");

MergedFS.Close();

Anyone??? I don’t know if there is a bug in the Aspose product or if my code is missing something.

Hi there,


Thanks for your inquiry. We are looking into your query and will get back to you soon.

Best Regards,

Thanks Tilal for your reply. I’m wondering if any progress has been made.


I’d be happy to provide more details if it would help. We’d really like to use this product, but so far we have not been able to make it perform as the Aspose documentation would have us believe.

Hi Matt,


Thanks for your patience. After initial investigation, we’ve logged your reported issue as PDFNEWNET-35706 in our issue tracking system for further investigation and resolution. We will keep you updated about the issue progress via this forum thread.

Sorry for the inconvenience faced.

Best Regards,