You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,9 @@
2
2
3
3
Convert HTML to PDFMake format with ease. This library bridges the gap between HTML content and [PDFMake](https://pdfmake.github.io/docs/) document definitions, allowing you to generate PDFs from basic HTML while maintaining based styling and structure.
4
4
5
-
**Note**: if you need to convert a complex HTML, check some online solutions, like [Doppio](https://doppio.sh/), or you could try to convert [your HTML to canvas](https://github.com/chearon/dropflow) or [to an image](https://github.com/zumerlab/snapdom) and then to [export it to PDF](https://github.com/parallax/jsPDF).
5
+
**Note**: if you need to convert a complex HTML (e.g. something produced by a Rich Text Editor), check some online solutions, like [Doppio](https://doppio.sh/), or you could try to convert [your HTML to canvas](https://github.com/chearon/dropflow) or [to an image](https://github.com/zumerlab/snapdom) and then to [export it to PDF](https://github.com/parallax/jsPDF).
6
+
7
+
This library will have the same limitation as PDFMake. If you need to verify if a style is supported by PDFMake, you can check [its documentation](https://deepwiki.com/bpampuch/pdfmake).
Copy file name to clipboardExpand all lines: docs/index.html
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ <h1>HTML to PDFMake convertor</h1>
116
116
<divid="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>
t.check(Array.isArray(ret)&&ret.length===1,"return is OK");
1260
+
t.check(ret[0].nodeName==="UL"&&Array.isArray(ret[0].ul)&&ret[0].ul.length===1,"root is UL with one LI");
1261
+
1262
+
// 2. Check the main LI stack
1263
+
varmainLiStack=ret[0].ul[0].stack[0].stack;
1264
+
t.check(Array.isArray(mainLiStack)&&mainLiStack.length===3&&mainLiStack[0].nodeName==="P"&&mainLiStack[1].nodeName==="OL"&&mainLiStack[2].nodeName==="P","main LI stack has 3 items (p, ol, p)");
1265
+
1266
+
// 3. Check 'sometitle' (first item in main stack)
1267
+
// This path (mainLiStack[0].stack[0]...) passed, so we keep it.
1268
+
t.check(mainLiStack[0].text[0].text==="sometitle","first P (sometitle)");
1269
+
1270
+
// 4. Check the nested OL (second item in main stack)
1271
+
varnestedOl=mainLiStack[1];
1272
+
t.check(nestedOl.nodeName==="OL"&&Array.isArray(nestedOl.ol)&&nestedOl.ol.length===5,"nested OL has 5 LIs");
1273
+
1274
+
// 5. Check 'sometitle2:' (first LI of the nested OL)
0 commit comments