-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to convert html table to PDF using PDFMake #34
Comments
It would have been nice to use a greeting, followed by a sentence, and even maybe a "thank you" at some point. This module is to transform HTML to PDFMake language, then PDFMake will do the hard work. The purpose of this tool is not to handle all CSS properties that exist today, especially when it becomes complicated design. When I test your code, I can see you use a lot of CSS styles, and many of them are not compatible with what PDFMake support. Something as simple as Also you use Long story short: your code is way too much complicated to be magically handled by |
As I said,
|
Thank for your response as per your findings i have removed colgroup and simplified html but still it gives me error of _calwidth as earlier i have posted with screenshot.
|
You HTML code is still dirty.... The correct code is: <table width="363">
<tbody>
<tr height="19">
<td height="82" width="25">Sr.</td>
<td width="212">Title</td>
<td width="126">DESC<br>?( Description )</td>
</tr>
<tr height="42">
<td height="84" rowspan="2" width="25">1</td>
<td rowspan="2" width="212">Test 1</td>
<td width="126">Test 1 Desc</td>
</tr>
<tr height="42">
<td height="42" width="126">Test 1 Desc 2</td>
</tr>
<tr height="84">
<td height="172" rowspan="2" width="25">2</td>
<td rowspan="2" width="212">Test 2</td>
<td width="126">Test 2 Desc</td>
</tr>
<tr height="88">
<td height="88" width="126">Test 2 Desc 2</td>
</tr>
</tbody>
</table> That renders as the below:
Please note that PDFMake doesn't support So, in your case it might be necessary to play with special properties. Example: <!-- the important part is the `data-pdfmake` that defines the width for each column ([25,212,126]) and the height each row ([19,42,42,42,42]) ––>
<table data-pdfmake="{"widths":[25,212,126],"heights":[19,42,42,42,42]}">
<tbody>
<tr height="19">
<td height="82" width="25">Sr.</td>
<td width="212">Title</td>
<td width="126">DESC<br>?( Description )</td>
</tr>
<tr height="42">
<td height="84" rowspan="2" width="25">1</td>
<td rowspan="2" width="212">Test 1</td>
<td width="126">Test 1 Desc</td>
</tr>
<tr height="42">
<td height="42" width="126">Test 1 Desc 2</td>
</tr>
<tr height="84">
<td height="172" rowspan="2" width="25">2</td>
<td rowspan="2" width="212">Test 2</td>
<td width="126">Test 2 Desc</td>
</tr>
<tr height="88">
<td height="88" width="126">Test 2 Desc 2</td>
</tr>
</tbody>
</table> |
? ( Description )
The text was updated successfully, but these errors were encountered: