Vanilla Quick Start
Get started by adding the @paprize/vanilla library to your project.
npm install @paprize/vanilla
- Add Report Components to your report.
- Create a
PaprizeReportinstance. - Add your sections to it.
- Add event listeners to adjust the content after pagination
- Schedule a pagination.
<div data-pz-preview>
<div data-pz-section id="section-1">...</div>
<div data-pz-section id="section-2">...</div>
</div>
<script>
import { pageSize, pageMargin } from '@paprize/core';
import { PaprizeReport } from '@paprize/vanilla';
const report = new PaprizeReport();
report.addSection({
id: 'section-1',
dimension: pageSize.A4,
margin: pageMargin.Narrow,
...configs,
});
report.addSection({
id: 'section-2',
dimension: pageSize.A5,
margin: pageMargin.None,
...configs,
});
report.monitor.addEventListener('pageCompleted', (pageContext) => {
if (pageContext.components.pageHeader) {
pageContext.components.pageHeader.innerHTML = ``;
}
});
await r.schedulePagination();
</script>