Free Support Forum - aspose.com

Stack overflow in Aspose.PDF DLL when saving PDF

Hi,

I’ve just been looking at how to put an ‘export to PDF’ button on some of my report web pages. Funnily enough I was writing my case study for Aspose and thought ‘I need a screenshot for that and have been meaning to get around to it!’ Anyway, I’m doing something wrong.

I used the exact code provided in the second sample at http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/html-to-pdf-using-inlinehtml.html

It purports to get a webpage from the net and save it, but instead I experience an exception on this line. I’m even using the same webpage the example does, I’ve only changed the output path! Any ideas?:

//Save the pdf document

pdf.Save(“c:/DirectHTML2pdf.pdf”);

Thanks


Hi,

Thanks for using our products.

The InLineHTML to PDF conversion method is a workaround and that why it's causing the problems. In fact we used to have a method named BindHTML which offered the capability to directly convert the HTML pages into PDF format. Our development team is working hard to rebuild this feature and once the functionality becomes available, we would be pleased to update you with the status of correction.

May be you can try converting the simple HTML page into PDF format and in case you face any problem, can you please share the sample HTML file so that we can test the scenario at our end. We apologize for your inconvenience.

Thanks. I tried some fairly simple files, but no luck. The page I actually want to export isn't visibly complex, but no luck at this stage.

Anyway, please let me know when you have an estimate of when this will again be available.

Also it would be good to remove the reference to bindHTML from the docs if it's gone, the page I referred to at the start of the thread still says 'of course you can use bindHTML' and I spent some time looking for it!

Cheers

Hi,

Can you please share the sample HTML file so that we can test the scenario at our end ?

Besides this, can you please point us to the location where you have seen the information which states that 'of course you can use bindHTML'.

However, once we have this method available, we would be pleased to update you with the status of correction. We apologize for your inconvenience.

Hi, Thanks for your continued efforts!

The reference to bindHTML is in the first line of this document:
http://www.aspose.com/documentation/.net-components/aspose.pdf-for-.net/html-to-pdf-using-inlinehtml.html

As for the page causing the crash, my page did crash it but I’m not sure how I would replicate something that lets you generate it (it uses master pages and the like). Saving it to disk probably won’t be the same since I’m using the 2nd example from the above page (accessing it from web server, not via file).

However, the same crash occurred when trying to convert the wikipedia main page shown in the article above, so you should be able to replicate it with that. Let me know how you go!

Thanks

Mark

Hello Mark,

Sorry for the confusion regarding BindHTML method information in documentation. Soon the documentation will be updated.

Regarding page conversion issue, I have tested the scenario using Aspose.Pdf for .NET 4.5.0 and I am unable to notice any problem. However the formatting inside PDF document is not correct but still the remote URL is being converted into PDF format. Please take a look over the attached resultant PDF that I have generated using Aspose.Pdf for .NET 4.5.0.

In case you still have any further query, please feel free to contact. We apologize for your inconvenience.