Aspose Hyperlink not working with 2012 server

We are having the Aspose.pdf version 8.8.0.0. and it worked fine until it was running in 2003 server. Recently we migrated to 2012 server and after that the pdf documents are not getting hyperlinked at all; even though the Aspose doesn’t complain or throws error. We have to make a quick decision/fix for the same. Request your earliest response to address our concern to remediate this problem.

Hi,


Thanks for contacting support.

Can you please share some code snippet so that we can try replicating the issue in our environment. We are sorry for this inconvenience.
In fact we have tried with Aspose.pdf.dll version 10.4.0.0 and its also not working as expected.
Note: My colleague is following up as well on this same issue "Re: Aspose Hyperlinks are not working"

Please refer the below my source code:

using Aspose.Pdf;
using Aspose.Pdf.InteractiveFeatures;
using Aspose.Pdf.InteractiveFeatures.Annotations;
using Aspose.Pdf.Text;
using Aspose.Pdf.Text.TextOptions;
using System.IO;
using System.Diagnostics;

string spattern = @"(?im)\b2015\b";
string inPutFile = @"D:\Projects\EaglePro_CMMI\PoC\TestHyperlink\TestHyperlink\Files\Input\705967-bad.pdf";
string outPutFile = @"D:\Projects\EaglePro_CMMI\PoC\TestHyperlink\TestHyperlink\Files\Output\Output.pdf";

TextFragmentCollection textFragmentCollection;
Stream input = System.IO.File.OpenRead(inPutFile);
Document doc = new Document(input);
TextFragmentAbsorber textFragmentAbsorber;
//IList annotations;
MemoryStream output = new MemoryStream();
// Create links for each dictionary entry.
foreach (Page p in doc.Pages)
{
//create TextAbsorber object to find all instances of the input search phrase
textFragmentAbsorber = new TextFragmentAbsorber(spattern, new TextSearchOptions(true));

//accept the absorber for all the pages
p.Accept(textFragmentAbsorber);

//Get the extracted text fragments
textFragmentCollection = textFragmentAbsorber.TextFragments;

//Loop through the fragments and create links.
foreach (TextFragment textFragment in textFragmentCollection)
{
// If the found text fragment contains newline character, reduce the box to the end of the of the line.
foreach (TextSegment s in textFragment.Segments)
{
LinkAnnotation link = new LinkAnnotation(p, s.Rectangle);
Aspose.Pdf.Point start = new Aspose.Pdf.Point(s.Rectangle.LLX, s.Rectangle.LLY);
Aspose.Pdf.Point end = new Aspose.Pdf.Point(s.Rectangle.LLX + s.Rectangle.Width, s.Rectangle.LLY);
LineAnnotation line = new LineAnnotation(p, s.Rectangle, start, end);

s.TextState.ForegroundColor = Aspose.Pdf.Color.Blue;
line.Color = Aspose.Pdf.Color.Blue;
s.TextState.Underline = true;
link.Contents = s.Text;
line.Border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(link) { Width = 1 };
link.Border = new Aspose.Pdf.InteractiveFeatures.Annotations.Border(link) { Width = 0 };
link.Action = new GoToURIAction("https://www.google.com");
p.Annotations.Add(link);
p.Annotations.Add(line);
}
}
}

// Save the document to memory stream.
doc.Save(output);

byte[] bytes;

bytes = new byte[output.Length];
output.Read(bytes, 0, (int)output.Length);
fs.Write(bytes, 0, bytes.Length);
output.Close();

ProcessStartInfo psi = new ProcessStartInfo(outPutFile);
psi.UseShellExecute = true;
Process.Start(psi);v

Hi,


Thanks for sharing the details.

Can you please share the input 705967-bad.pdf file, so that we can test the scenario in our environment.

Please find attached the requested file

Hi,

Thanks for sharing the resource file.

I have tested the scenario and I am able to reproduce the same problem. Even I am able to replicate the issue over Windows 7 (x64) while using Visual Studio 2012. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-38745. We will investigate this issue in detail and keep you updated on the status of a correction.

We apologize for your inconvenience.