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

Free Support Forum - aspose.com

Converting HTML to PDF using Aspose.pdf is having issue with inline anchor tag

Hi Team,

I am using Aspose.PDF version 18.12.0.0 to convert HTML to PDF.

My HTML contains inline anchor tags which are working perfectly when i browse the HTML file.
But these inline tags are not working in PDF.

I am setting the anchor tags as below,

    <a name="content1" href="#content2">For Content 2 click here </a>
    <a name="content2" href="#content1">For Content 1 click here</a>

@sunithamaddi

Thanks for contacting support.

We have tested the scenario in our environment using Aspose.PDF for .NET 19.2 and were able to reproduce the issue that you have mentioned. For the sake of correction, we have logged it as PDFNET-46107 in our issue tracking system. We will further look into details of the issue and keep you posted with the status of its correction. Please be patient and spare us little time.

We have used following code snippet for testing:

Aspose.Pdf.HtmlLoadOptions objLoadOptions = new Aspose.Pdf.HtmlLoadOptions();
objLoadOptions.PageInfo.Margin.Bottom = 0;
objLoadOptions.PageInfo.Margin.Top = 0;
objLoadOptions.PageInfo.Margin.Right = 0;
objLoadOptions.PageInfo.Margin.Left = 0;
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "InlineAnchor.html", objLoadOptions);
doc.Save(dataDir + "output.pdf");

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-46107) have been fixed in Aspose.PDF for .NET 19.4.