I am generating a PDF from a html file using HtmlFormatProvider, RadFlowDocument and PdfFormatProvider.
The generated PDF contains some large tables that is not rendered correctly.
This can be solved if I can set the html page witdth somehow. Is it possible?
2 Answers, 1 is accepted
0
Dimitar
Telerik team
answered on 22 Nov 2019, 12:35 PM
Hi Peter,
You can set the width of the table. Here is an example:
RadFlowDocument document;
var htmlProvider = new HtmlFormatProvider();
document = htmlProvider.Import(File.ReadAllText(@"D:\test2.html"));
foreach (Table table in document.EnumerateChildrenOfType<Table>())
{
table.LayoutType = TableLayoutType.FixedWidth;
table.PreferredWidth = new TableWidthUnit(2000);
}
I hope this helps. Please let me know if you have additional questions.
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers.Learn More.