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

Free Support Forum - aspose.com

Wrong extracted link count (from pDF document)

Hello,

I am generating pDF file form HTML using Aspose.Words latest version. In order to test the links in my pdf file I use Aspose.Pdf as follows:
(This is a Power Shell code)
$pdf = new-object Aspose.pdf.Document(“C:\MYSCRIPTS\TestLinkAsText.pdf”)
#LinkAnnotation linkAnnot = (LinkAnnotation)doc.Pages[1].Annotations[1];
$list = $pdf.Pages[1].Annotations
$list.Count

Although I have only one link in the document, I get a list of 7 (SEVEN!) links. They are all the same, but my test fails. This happens only for file:// links
Here is source HTML
Untitled Page
I attached the resulting PDF file
This issue does not allow us to write proper acceptance test and is critical for us.
Thank you,
Alexei

Hello,

I am converting simple html with a link to a file to PDF
=========================
Untitled Page

=====================================
For my acceptance test, I have to extract and check the link from created pDF file. Instfead of having one link to a file, I get 7 (SEVEN) exactly same links. Below is powershell code:

clear-host
# .\PDF_LINKS_CREATE_READ.ps1
sl C:\MYSCRIPTS
$bin = "C:\Program Files (x86)\Aspose\Aspose.Pdf for .NET\Bin"
add-type -Path “$bin\net2.0\Aspose.Pdf.dll”
$bin = "C:\Program Files (x86)\Aspose\Aspose.Words for .NET\Bin"
add-type -Path “$bin\net2.0\Aspose.Words.dll”
.\L1.ps1

$doc = new-object Aspose.Words.Document
$builder = new-object Aspose.Words.DocumentBuilder($doc)
$htmlstr = get-content “C:\MYSCRIPTS\LINK_AS_TEXT.htm”
$htmlstr
$builder.InsertHtml($htmlstr)
$doc.Save(“C:\MYSCRIPTS\TestLinkAsText.pdf”)
$pdf = new-object Aspose.pdf.Document(“C:\MYSCRIPTS\TestLinkAsText.pdf”)
#LinkAnnotation linkAnnot = (LinkAnnotation)doc.Pages[1].Annotations[1];
$list = $pdf.Pages[1].Annotations
$list.Count
Foreach ($item in $list) {
$curaction = $item.Action.URI
$curaction
“Item ================”
}

Having acceptance tests is very critical for us and this issue is a showstopper.
I am using sver = "8.6.08.6.0Aspose.Pdf"
and Aspose.Words "13.10.0.0"
Please note that if I do html to pdf convesion using other 3rd party library, I get correct count of links from my script. Looks like the problem is in conversion and not in extraction.
I attach generated pdf file as well
Thank you,
Alexei

Hi Alexei,

We are sorry for the inconvenience faced. While testing the scenario with latest version of Aspose.Pdf for NET 8.7.0, we have managed to notice incorrect number of link annotation and logged it in our bug tracking system as PDFNEWNET-36151 for further investigation and resolution. We have also linked your request to this issue and you will be notified via this thread as soon as it is resolved.

Please feel free to contact us for any further assistance.

Best Regards,

Hi Alexei,

Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSNET-9369 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Alexei,


We have further investigated the PDF document and found that there are actually 7 link annotations exist in the PDF document. These annotations are not visible because they don’t have appearance.
Annotations are under the text on the page (“Link to external image”), every annotation is situated under corresponding word or space between words:
1) “Link”, 2) " ", 3) “to”, 4) " ", 5) “external”, 6) " ", 7) “image”.

To view these link annotation we have added border for every annotation.

Document doc = new Document(myDir+“out.pdf”);
foreach (Aspose.Pdf.InteractiveFeatures.Annotations.Annotation annot in doc.Pages[1].Annotations)
{
annot.Border.Width = 1;
}
doc.Save(myDir+“Annotation_border.pdf”);

Probably this issue is related to Aspose.Words conversion. However, we will keep you updated about the issue resolution progress via this forum thread.

Best Regards,

Hi Alexei,

Thanks for your inquiry via live chat about the ETA of issue (WORDSNET-9369).

I have verified the status of this issue from our issue tracking system and regret to share with you that this issue has been postponed till a later date due to some other important issues and new features. We will inform you as soon as there are any further developments.

We apologize for your inconvenience.

The issues you have found earlier (filed as PDFNEWNET-36151) have been fixed in Aspose.Pdf for .NET 8.8.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

The issues you have found earlier (filed as WORDSNET-9369) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.