Creating Links inside scanned PDF first page

Hi,

I am trying to create Hyperlinks with GoToR action for the attached scanned pdf file.

Though the link is saved to the PDF file successfully. It is not showing,
when we open after saving the document. Kindly help us to resolve the issue.

zynteglo-us-cassette-label-draft.pdf (243.9 KB)

@iarabhavi

Can you please also share the sample code snippet with expected output PDF so that we can test the scenario in our environment and address it accordingly.

private void Logic()
{
// Open document
Document doc = new Document();

// Create link
Page page = doc.Pages.Add();

//Create Rectangle Object
var rectangle = new Aspose.Pdf.Rectangle(20, 500, 120, 600);

// Create Link annotation object
LinkAnnotation linkFileScanned = new LinkAnnotation(page, rectangle);

linkFileScanned .Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Black);

linkFileScanned .Action = new GoToRemoteAction($"{PartialPath}_linkScanned.pdf", 1);

page.Annotations.Add(linkFileScanned );

// Save updated document
doc.Save($"{PartialPath}_output.pdf");

}

After saving we are not able to find the Hyperlink on reopening the file. It is happening for first page of scanned files.

@prnksheela

Have you tried adding the hyperlink using Adobe Reader? If you are able to achieve the expected results, can you please share the expected output with us as well? It would help us in investigating the issue accordingly.

Please find the doc, where links added through the Adobe.

zynteglo-us-cassette-label-draft.pdf (270.4 KB)

@prnksheela

It looks like the API is not able to place the link at the right location. We used below code snippet and the link was added at the wrong position as shown in the attached output and screenshot.

Document doc = new Document(dataDir + "zynteglo-us-cassette-label-draft.pdf");
TextFragmentAbsorber absorber = new TextFragmentAbsorber("See full prescribing information for dosage and administration");
doc.Pages.Accept(absorber);

// Create Link annotation object
LinkAnnotation linkFileScanned = new LinkAnnotation(doc.Pages[1], absorber.TextFragments[1].Rectangle);

linkFileScanned.Color = Aspose.Pdf.Color.FromRgb(System.Drawing.Color.Black);

linkFileScanned.Action = new GoToRemoteAction($"{dataDir}sample1.pdf", 1);

doc.Pages[1].Annotations.Add(linkFileScanned);
doc.Save(dataDir + "outputhyperlinkswithindoc1.pdf");

outputhyperlinkswithindoc1.pdf (226.8 KB)
image.png (46.2 KB)

Therefore, we have logged an issue as PDFNET-55186 in our issue tracking system. We will further look into its details and keep you posted with the status of its rectification. Please be patient and spare us some time.

We are sorry for the inconvenience.

any update on the issue reported?

@prnksheela

We are afraid that the earlier logged ticket has not been yet resolved due to other issues in the queue. We have recorded your concerns and will surely inform you as soon as we make some progress towards its resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.