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

Free Support Forum - aspose.com

HTML to PDF conversion- hyperlinks to content on same file not working

I have an existing html file with hyperlinks to content in same file. Below is a sample of the html in the file.

Link:
Section 5
Content:

section 5 content is here


When this is converted to PDF the local links are not working anymore. Below is the conversion code:

public Stream ConvertHtmlToPDF(Stream inputStream, string docTitle)
{
Stream pdfStream = new MemoryStream();
inputStream.Position = 0;
var options = new HtmlLoadOptions();
var pdfDocument = new Aspose.Pdf.Document(inputStream, options);
pdfDocument.Info.Title = docTitle;
pdfDocument.Save(pdfStream);
}


Hi There,


Thanks for contacting support.

I have tested the scenario and have managed to reproduce the issue that while converting HTML to PDF local links are not working. For the sake of correction, I have logged a ticket PDFNET-42643 in our issue tracking system. We will further look into the details of this issue and will keep you updated on the status of its correction. Please be patient and spare us little time. We are sorry for this inconvenience.

Best Regards,

Do you have any timeline on when the issue will be fixed? Also what are the options I have to get a priority patched package for this? It will be great for me to set the delivery expectation right as this is a big issue in my current work.

Hi,

Thanks for your patience.

As we recently have noticed earlier reported issue, so its pending for review and is not yet resolved. However the product team will surely consider investigating/fixing it as per development schedule and as soon as we have some definite updates regarding its resolution, we will let you know.

Now concerning to your query on getting priority patched package, we have Priority and Enterprise Support options which are paid support services. Please note that these options do not guarantee any immediate resolution, but it expedites the investigation process related to specific problem.

Please be patient and spare us little time. We are sorry for this delay and inconvenience.

Any update on this issue?

Hi,


Thanks for your patience.

I am afraid the problem is not yet resolved and is pending for review. However the product team will investigate it as per their schedule and as soon as we have some further updates, we will let you know.

Please be patient and spare us little more time. Your patience and comprehension is greatly appreciated in this regard.

Hi support.

Any update on ticket PDFNET-42643 ? We are waiting for resolve that issue. Thanks

@vunguyen

Thank you for getting back to us.

We are afraid PDFNET-42643 is still pending for investigations owing to previously logged and critical tickets. We have recorded your concerns under respective ticket and its priority has been raised to next level. We will let you know as soon as some significant updates will be available in this regard. We appreciate your patience and comprehension in this regard.

Hi I am doing html to pdf conversion, for that first I saved html into xls (we just changed the file extension) format first.(but internally it is html file format) then converting into pdf using Aspose.PDF. In html page I have html table and i want the header of table to be repeated in all the pages of pdf . For e.g row number 1 to 3 of html table OR Html header tag to be repeated in all the pages of pdf . Is it possible ? or if there is any work around to handle it ?
Or Can we convert directly from HTML to PDF with repeat headers, styles etc.

Please suggest. I am using aspose.pdf version 18. Eagerly waiting for the response. Thank You.

@PolarisAP

Thank you for contacting support.

You may convert the HTML to PDF with Aspose.HTML for .NET as explained in HTML to PDF Conversion.

To make HEADER content repeat on every page before tables content, it should be placed inside thead element:

<table>
<thead>
<tr>
<td>
This content is repeated.
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
Table content.
</td>
</tr>
</tbody>
</table>

In case this does not help then please share the source and generated files along with narrowed down code snippet so that we may investigate further to help you out.

@Farhan.Raza

Thanks for the reply.
I have tried above option using Aspose.HTML for .NET . But header is not repeating in every page of pdf.
I have attached html input file and output pdf file.Files.zip (117.3 KB)

Below is code for i am using for rendering html to pdf.
string dir = @“directoryName”;
string FileName = “HCP_Fees_for_Services_and_Consultancy_20181114114513242_copy.html”;
string inputfileName = dir + FileName;
string outputfileName = dir + “checkdatasa_copy.pdf”;

        var width = Aspose.Html.Drawing.Unit.FromMillimeters(297);
        var height = Aspose.Html.Drawing.Unit.FromMillimeters(420);
        var pageSizeA3 = new Size(width, height);

        var margins = new Margin(
            Aspose.Html.Drawing.Unit.FromMillimeters(15), // left
            Aspose.Html.Drawing.Unit.FromMillimeters(10), // top
            Aspose.Html.Drawing.Unit.FromMillimeters(15), // right
            Aspose.Html.Drawing.Unit.FromMillimeters(20));// bottom

       HTMLDocument hTMLDocument = new HTMLDocument(inputfileName);
        var options = new PdfRenderingOptions
        {
            PageSetup = { AnyPage = new Aspose.Html.Drawing.Page(pageSizeA3, margins),
            AdjustToWidestPage = true}
            
        };
        PdfDevice pdfDevice = new PdfDevice(options,outputfileName);
        var renderer = new HtmlRenderer();
        renderer.Render(pdfDevice, hTMLDocument);

@PolarisAP

Thank you for sharing your findings.

We have been able to reproduce the issue in our environment. A ticket with ID HTMLNET-1629 has been logged in our issue management system for further investigation and resolution. We will notify you as soon as the ticket will be resolved.

We are sorry for the inconvenience.

Hi Support,
Any update on ticket HTMLNET-1629 ? We are waiting for this issue to resolve.
Can you give estimate time for this ticket to get resolved?
Thanks

@PolarisAP

The issue has recently been logged in our issue management system and is currently pending for investigations which may take a few months to resolve owing to previously logged tickets. We will let you know as soon as some ETA or significant updates will be available in this regard. We appreciate your patience and comprehension in this regard.

However, we also offer Paid Support, where issues are used to be investigated with higher priority. Our customers, who have paid support subscription, report their issue there which are meant to be investigated urgently. In case your reported issue is a blocker, you may please consider subscribing for Paid Support. For further information, please visit Paid Support FAQs.