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

Free Support Forum - aspose.com

Table and text syles problem

Hi,


I’m working in company where Aspose is used. We have license for using library. I was assigned a task to improve view of some reports but I have huge problems with that.

I’ve attached two examples of table generation. I can say that all browsers have no problem with that table (attachment: table2.jpg). Other companies library like ABCpdf also are rendering this table correctly. (attachment: table3.jpg).

I want the table to adjust to the content and not wrap text if possible, but when I give the overall table width it gives for each column the same width . (attachment: table2.jpg). If I omit the overall table width the table overflows from the pdf document (it is cut in the middle). How to solve that ? (borders are only used here to show my point)

The second huge problem is with css property - > line-height. No matter what I do Aspose can’t interpret this properly. I was trying in version 6.7 and in 8.0.

Please help with my problems. If I wont get any answer I would be forced to persuade my manager to switch for other party libraries.


Hi there,

orticelo:
I want the table to adjust to the content and not wrap text if possible, but when I give the overall table width it gives for each column the same width . (attachment: table2.jpg). If I omit the overall table width the table overflows from the pdf document (it is cut in the middle). How to solve that ? (borders are only used here to show my point)

Please check this post for setting column width dynamically to length of contents. Hopefully it will help you to accomplish your requirements.

orticelo:
The second huge problem is with css property - > line-height. No matter what I do Aspose can't interpret this properly. I was trying in version 6.7 and in 8.0.

Can you please share your sample code here? So we will look into it and will provide you more information accordingly.

Best Regards,


tilal.ahmad
Please check this post for setting column width dynamically to length of contents. Hopefully it will help you to accomplish your requirements.
Sorry but I don't see any link to related post ?
tilal.ahmad
Can you please share your sample code here? So we will look into it and will provide you more information accordingly.
About Line Height : I've attached archive with html file. And here below is part of c# code responsible for generating pdf.

code:
var pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

StreamReader r = File.OpenText(@"C:\one_LineHeightTest.html");
var text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());
text2.IsHtmlTagSupported = true;
text2.IsHtml5Supported = true;
section.Paragraphs.Add(text2);
pdf.Save(@"one.pdf");


orticelo:
About Line Height : I’ve attached archive with html file. And here below is part of c# code responsible for generating pdf.
Hi,

Thanks for sharing the resource file.

I have tested the scenario and I am able to
notice the same problem. For the sake of correction, I have logged this problem
as PDFNEWNET-36167 in our issue tracking system. We will further
look into the details of this problem and will keep you updated on the status
of correction. Please be patient and spare us little time. We are sorry for
this inconvenience.
Hi there,

orticelo:
tilal.ahmad
Please check this post for setting column width dynamically to length of contents. Hopefully it will help you to accomplish your requirements.
Sorry but I don't see any link to related post ?
tilal.ahmad
Can you please share your sample code here? So we will look into it and will provide you more information accordingly.
About Line Height : I've attached archive with html file. And here below is part of c# code responsible for generating pdf.

code:
var pdf = new Aspose.Pdf.Generator.Pdf();
Aspose.Pdf.Generator.Section section = pdf.Sections.Add();

StreamReader r = File.OpenText(@"C:\one_LineHeightTest.html");
var text2 = new Aspose.Pdf.Generator.Text(section, r.ReadToEnd());
text2.IsHtmlTagSupported = true;
text2.IsHtml5Supported = true;
section.Paragraphs.Add(text2);
pdf.Save(@"one.pdf");



We are sorry for the inconvenience caused. Please check above stated post here. Hopefully it would help you to set column widths as per contents.

Best Regards,

Example form suggested post assuming table generation form code. So It wont help me to solve my problem.

The point is to accomplish the goal using only css styles. Which is not problem while using other libraries.

Hi there,


Can you please share your sample code and source document? So we will test the scenario and will provide you more information accordingly.

We are sorry for the inconvenience caused.

Best Regards,
Hi,

I attachment there is zipped html file with the table I mentioned.

BR


Hi there,


Thank you for sharing source HTML file. While testing the scenario with the latest version of Aspose.Pdf for NET 8.7.0, We have managed to reproduce the reported table formatting issue and logged it in our bug tracking system as PDFNEWNET-36201 for further investigation and resolution. We will notify you via this thread as soon as it is resolved.


We are sorry for the inconvenience caused.


Best Regards,

The issues you have found earlier (filed as PDFNEWNET-36201) have been fixed in Aspose.Pdf for .NET 8.9.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi,


Thanks for your patience.

In order to resolve PDFNEWNET-36201, please try using the new Document Object Model of Aspose.Pdf namespace for HTML to PDF conversion.

[C#]

<span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#2B91AF”>HtmlLoadOptions options = <span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;mso-fareast-font-family:
“Times New Roman”;color:blue”>new <span style=“font-size:10.0pt;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#2B91AF”>HtmlLoadOptions();<o:p></o:p>

options.UseNewConversionEngine = true;

Document doc = new Document(@"D:\input\SampleFile.html", options);

doc.Save(<span style=“font-size:10.0pt;line-height:115%;font-family:“Arial”,“sans-serif”;
mso-fareast-font-family:“Times New Roman”;color:#A31515;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>@“D:\pdftest\SampleFile.pdf”);

The issues you have found earlier (filed as PDFNEWNET-36167) have been fixed in Aspose.Pdf for .NET 9.4.0.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.