Configuration of Margins
The PDF Processing package delivers options for setting the margins of the output PDF files.
To set the margin of an output file, you can use any of the following approaches:
- Setting the margin as a property
- Setting the margin as a child component
- Setting the margin as an argument
Setting Margins as Properties
To set the margin as a property, use the PDFExport
component and the margin
property.
<PDFExport margin={{ top: 20, left: 100, right: 30, bottom: 40 }} >
<DataToExport />
</PDFExport>
<PDFExport margin="2cm" >
<DataToExport />
</PDFExport>
Setting Margins as Arguments
To set the margin as an argument, use the savePDF
method and the margin
option.
import { savePDF } from '@progress/kendo-vue-pdf';
savePDF(domElement, { margin: "2cm" });