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

Free Support Forum - aspose.com

COnversion HTML To PDF

Hi,

Could you explain to me why the conversion of the HTML File (see attachment) works with ASPOSE PDF 3.4 with the method "BindHTML" but doesn't work with Aspose PDF 6.0 with the code below :

Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();

Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
StreamReader r = File.OpenText(@"c:/test15.html");
Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());

text2.IsHtmlTagSupported = true;
pdf.HtmlInfo.ImgUrl = "c:/pdftest/MemoryStream/";
section.Paragraphs.Add(text2);
pdf.Save("c:/pdftest/MemoryStream/HTML1pdf.pdf");

(I use .net 1.1)

Thanks !

Hi,

Thanks for using our products.

As you have stated, we used to have BindHTML(…) method to convert HTML pages into PDF format but due to some serious technical difficulties, we had to remove this functionality and had to rewrite the HTML to PDF conversion code. Now in latest release versions, you can convert HTML pages into PDF format using InLineHTML approach and I am afraid it does not include any method named BindHTML(…).
I have tested the scenario while converting the HTML file into PDF format with Aspose.Pdf for .NET 6.0.0 while using the InLineHTML approach and as per my observations, the resultant PDF seems to be correct (Except there are some formatting issues and I have logged it as PDFNEWNET-29761 in our issue tracking system). Can you please take a look over the resultant PDF that I have generated.

PS, The only change that I have made in code is that I have specified the page orientation as Landscape.

Thanks for your answer.

I have an error when i do the same things with the following code :

(I just created a button on a blank page which save the pdf ) :

I use .net 1.1:

private void Button1_Click(object sender, System.EventArgs e)
{
Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

StreamReader r = File.OpenText(@"c:/test15.html");
Aspose.Pdf.Generator.Text text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());

text2.IsHtmlTagSupported = true;
pdf.HtmlInfo.ImgUrl = "c:/pdftest/MemoryStream/";
section.Paragraphs.Add(text2);
pdf.IsLandscape = true;
pdf.Save("c:/pdftest/MemoryStream/HTML1pdf.pdf");
}

There is nothing in the directory "c:/pdftest/MemoryStream/"

I have the error "Invalid index in rows indexer: -1" (see attachment).

Thanks for your help.

Hi,

Thanks for contacting support.

I have again tested the scenario in Windows as well as in web application and I am unable to notice any problem while converting HTML file into PDF format. I have used the same code snippet as you have shared in your last post. Can you please share some details regarding your working environment i.e. Operating System, .NET Framework version, VisualStudio version etc. We are really sorry for this inconvenience.

Hi,

My operating System is Windows XP.

I work with VisualStudio 2003 ( .NET Framework 1.1) and Aspose 6.

I obtain the same error than "Jagdish K" in the post "Pdf save error" on this forum.

I 've done an other test :

I replaced in the HTML code : width="800" by width="100%" and all width="400" by width="50%" and i didn't reproduced the same problem but the resulting PDF is not good (see attachement).

Thanks.

Hi,

Thanks for sharing the details.

I have again tested the scenario using Aspose.Pdf.dll from net1.1 folder and I am able to notice the same exception. For the sake of correction, I have logged it as PDFNEWNET-29890 in our issue tracking system. We will further look into the details of this problem and will keep you you updated on the status of correction. We are sorry for your inconvenience.

Besides this, when I have used aspose.Pdf.dll from net2.0 folder, I am unable to notice any error. Can you please try using the product version form this folder and see if it can resolve your problem. For your reference, I have also attached the resultant PDF that I have generated using Aspose.Pdf for .NET 6.1.0. Please download the latest product version form this link.

Thanks for your answer.

I can't use the aspose.Pdf.dll from net2.0 folder because i'm working on .net 1.1 framework and VisualStudio 2003 raises an error if i try to add the reference to that DLL.

I tryed to use the lastest version of your product (6.1) for .net 1.1 and a new problem occured : the resultant PDF is in attachment.

But i no longer have the error of my first post.

Can you tell me when the next MSI will be generate ?

Thanks.

Hi,

We have made recent development / improvements in product versions under .net2.0 and later versions and I am afraid we might not be able to fix the formatting issues in .net1.1. However we will try level best to fix the exception issues in .net 1.1. Please be patient and spare us little time. We apologize for your inconvenience.

The issues you have found earlier (filed as 29761 ) have been fixed in this update.


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

The issues you have found earlier (filed as PDFNEWNET-29890) have been fixed in this update.


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