Comments (3)
line-height
in PDFMake doesn't work like in HTML/CSS. I'd recommand to use a number value only instead of a number + "px/%" (e.g. line-height:1.2
), and to do some test in the PDFMake playground to find which value would work best with your expectation. In your case, the use of line-height
is weird, and maybe a padding/margin would be good enough?!
Also your HTML code is messy and has too many layers of unnecessary tags, that may cause an unexpected result. The translation of the HTML to PDFMake is very complex, and this tool is only here for simple code and quick page layout.
Try to simplify your HTML code. For example:
<div id='element-to-print'>
<div style="color: #2d2d2d;font-weight:bold;margin-top:5px;font-size:19.2px;">First sentence</div>
<ul>
<li>Option 1</li>
<li>Option 2</li>
<li>Option 3</li>
</ul>
<div style="color: #2d2d2d;font-weight:bold;margin-top:15px;font-size:19.2px;">Second sentence</div>
<ul>
<li>Option 4</li>
</ul>
</div>
And finally, be aware that <p>
adds by default a margin which could also impact the result.
from html-to-pdfmake.
Also your HTML code is messy and has too many layers of unnecessary tags,
Yes, this code generated by html WYSIWYG editor. Whoever using it doesn't understand html code well, but this code valid. I can't really tell them how to modify html for export optimization. Only solution for now is to disable line-height.
from html-to-pdfmake.
Yes, I think it's better to remove line-height
in your case :-)
from html-to-pdfmake.
Related Issues (20)
- <td> rowspan break the pdfMake HOT 7
- row break between pages HOT 3
- How to arrange the pictures in one line, one after another? HOT 5
- Feature request: support for native Ecma script modules HOT 3
- Cannot load images in the Node.js environment HOT 2
- Support for header / footer HOT 4
- Table cell organization bug HOT 3
- Freeze bug HOT 4
- Adding extra white space in pdf. HOT 8
- Cannot size an image HOT 10
- img breaks line HOT 1
- lineHeight property handling HOT 5
- Feature request: handle and support invalid image HOT 1
- Issue with list items not rendering HOT 3
- Feature Request: HOT 2
- Bug: Table widths parsing issue HOT 2
- Dynamic table widths update HOT 11
- ErrorHandler: TypeError: cellWidth.replace is not a function at index.js:385:105 HOT 5
- Copying and pasting the text "finally" from the PDF and the letter "i" is not included when pasted HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from html-to-pdfmake.