Skip to content

Commit 6664c59

Browse files
committed
v2.5.18
fixed #232
1 parent 579a7f4 commit 6664c59

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

browser.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/browser-2.5.17.js

-1
This file was deleted.

docs/browser-2.5.18.js

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h1>HTML to PDFMake convertor</h1>
116116
<div id="pdf_ie" style="display:none;padding:3em">The PDF file is sent to you for download. Use a modern browser (like Chrome or Firefox) to display the PDF in this page.</div>
117117
</div>
118118
</div>
119-
<script src="browser-2.5.17.js"></script>
119+
<script src="browser-2.5.18.js"></script>
120120
<script src="https://cdn.jsdelivr.net/npm/pdfmake@latest/build/pdfmake.min.js"></script>
121121
<script src="https://cdn.jsdelivr.net/npm/pdfmake@latest/build/vfs_fonts.js"></script>
122122
<script>

example.pdf

0 Bytes
Binary file not shown.

index.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,14 @@ function htmlToPdfMake(htmlText, options) {
345345
var colGroups = element.children[ tableColgroupIndex ];
346346
// get colgroup by cell index
347347
var colElement = colGroups.children[ cellIndex ];
348-
var colAttrWidth = colElement.getAttribute( "width" ) || "";
349-
var colStyleWidth = colElement.style.width;
348+
if (colElement) {
349+
var colAttrWidth = colElement.getAttribute( "width" ) || "";
350+
var colStyleWidth = colElement.style.width;
350351

351-
if ((colAttrWidth||colStyleWidth).endsWith("%")) {
352-
// update cell width to its percentage in colgroup
353-
width = (colAttrWidth||colStyleWidth);
352+
if ((colAttrWidth||colStyleWidth).endsWith("%")) {
353+
// update cell width to its percentage in colgroup
354+
width = (colAttrWidth||colStyleWidth);
355+
}
354356
}
355357
}
356358

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "html-to-pdfmake",
3-
"version": "2.5.17",
3+
"version": "2.5.18",
44
"description": "Convert HTML code to PDFMake",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)