Getting Started with PDF
Prerequisites
An HTML code you want to convert into PDF
Transformers
HTML into PDF
This module is based on the node-html-pdf converter.
Converts an HTML code into a PDF file.
Select format | Select whether you want to use a predefined format or a custom format.
|
HTML | Enter the HTML code.
Example of use The output PDF contains a barcode created from the text using the Libre Barcode 128 font.
Using images There are two ways how one can insert an image into the output PDF from the HTML. 1. Standard linking using the img src tag:
2. Mapping the image using Make modules and base64 encoding scheme:
Replace the
Replace "5.data" by mapped data from the previous module, e.g. Dropbox > Get a file. Sample scenario
|
Border | Define the PDF border size. Allowed units are mm, cm, in, px. |
Header |
|
Footer |
|
Zooming Result PDF When Using Millimeters
When millimeters (mm
) are used in the position: absolute;
definition, zoom the result PDF in the body
as seen in the following example:
<style>
* {
border: 1px dotted black;
box-sizing: border-box;
}
body {
margin: 0;
font-family: sans-serif;
zoom: 75%
}
.header {
position: absolute;
width: 180mm;
height: 45mm;
left: 20mm;
top: 0mm;
}
.address-area {
position: absolute;
width: 85mm;
height: 45mm;
left: 20mm;
top: 45mm;
padding-left: 5mm;
}
.address-area .return {
width: 100%;
height: 5mm;
font-size: 80%;
}
.address-area .note {
width: 100%;
height: 12.7mm;
}
.address-area .address {
width: 100%;
height: 27.3mm;
}
.info {
position: absolute;
width: 75mm;
height: 40mm;
left: 125mm;
top: 50mm;
}
.text {
position: absolute;
width: 165mm;
height: 155mm;
left: 25mm;
top: 108mm;
}
.footer {
position: absolute;
width: 165mm;
height: 15mm;
left: 25mm;
top: 273mm;
}
img {
width: 100%;
}
.logo {
position: absolute;
left: 5mm;
bottom: 10mm;
width: 80mm;
}
</style>
<div class="header">
</div>
<div class="address-area">
<div class="return">
</div>
<div class="note">
</div>
<div class="address">
</div>
</div>
<div class="info">
</div>
<div class="text">
</div>
<div class="footer">
</div>