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

Free Support Forum - aspose.com

Conversion of HTML with two-column tables to PDF

Hi,
I try to write a piece of software which will show some html content and allow users to download it as pdfs. In html documents there there occur tables with two columns where the left one contains some short description and the right one long text.

Unfortunately in the generated pdf file only the wide column is rendered. I attach html, pdf and source code snippet in zip file.

Is this a bug or am I doing something wrong?

I’m using Aspose.Pdf v5.3 with .net 4 framework.

Thanks in advance.

Hello Tomasz,

Thanks for using our products.

I have tested the scenario using Aspose.Pdf for .NET 6.0.0 and I am unable to notice any problem. I have used the code snippet shared over
How to – Convert HTML to PDF using InLineHTML approach

Can you please try using this version and in case you still face any problem or you have any further query, please feel free to contact. We apologize for your inconvenience.

For your reference, I have attached the resultant PDF document that I have generated.

Hello,
Sorry I didn’t check that issue in newest version. Aspose.pdf 6.0.0 solves the problem (as well as 5.4.0). Thanks for quick response.

Hello Tomasz,

I am pleased to hear that your problem is resolved. Please keep using our products and in case you encounter any problem or you have any further query, please feel free to contact. Together we can make Aspose a world leading file Format Company.

Unfortunately I have found a related issue in Aspose.Pdf version 6 as well.

Now I have a html document containing table with one column having width specified explicitly in percent or pixels. When I generate pdf both columns get equal width. I tried with the latest version (6.1.0.0) and the results were incorrect. I also checked version 5.3.0.0 which was previously used in the company and it worked as expected - the width of the first and second column was different. Please see generated pdf files in the attachment.

I attach source code fragment used to generate pdf, html document and two generated pdfs using version 5.3.0.0 and 6.1.0.0. I hope you’ll be able to give a quick response as previous time.

Thanks in advance.

Hello Tomasz,

Thanks for sharing the resource files.

I have tested the scenario using Aspose.Pdf for .NET 6.1.0 and I am unable to notice any problem. Please take a look over the attached resultant PDF documents that I have generated using following code snippet. In case you still face any issue or you have any further query, please feel free to contact. We apologize for your inconvenience.

You can download Aspose.Pdf for .NET from this link.

[VB.NET]


’ Instantiate an object PDF class
Dim pdf As Aspose.Pdf.Generator.Pdf = New Aspose.Pdf.Generator.Pdf()
’ add the section to PDF document sections collection
Dim section As Aspose.Pdf.Generator.Section = pdf.Sections.Add()
’ Read the contents of HTML file into StreamReader object
Dim r As StreamReader = File.OpenText(“D://pdftest//TableIssue//TableIssue.html”)
‘Create text paragraphs containing HTML text
Dim text2 As Aspose.Pdf.Generator.Text = New Aspose.Pdf.Generator.Text(section, r.ReadToEnd())
’ enable the property to display HTML contents within their own formatting
text2.IsHtmlTagSupported = True
’ Add the text object containing HTML contents to PD Sections
section.Paragraphs.Add(text2)
'Save the pdf document
pdf.Save(“D://pdftest//TableIssue//TableIssue.pdf”)

Sorry, it looks like I used version 6.0 instead of 6.1.

The described problem with fixed width columns looks solved in 6.1. However the not visible thin column issue is back. I get the same results as in version 5.3 again. In the attachment there are two pdf files: one generated using Aspose.Pdf 6.0 and other using version 6.1. Note that the left column in the second table is completely invisible.

Hello Tomasz,<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

I
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as <span style=“font-family:“Arial”,“sans-serif””>PDFNEWNET-30337. We
will investigate this issue in details and will keep you updated on the status
of a correction.<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””><span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif””>

We
apologize for your inconvenience.

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


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

Hi,
I’ve just got a notification that the issue was solved in version 6.4. Unfortunately in the generated pdf I still get the bad layout with one thin (invisible) column and other which fills the whole width of the table. I attach the result file (same code and html content as in my previous posts).

Regards
Tomasz Tretkowski

Hi Tomasz,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please accept our apologies for the inconvenience. We have retest the issue and found the problem you reported in the latest version. I have notified the development team to further look into your issue and as soon as I get any response from the development team, I will update you via this forum thread.

Sorry for the inconvenience,