@page size did not work on raw-html
- Dominant language
- JavaScript
- Stars
- 4.5k
- Forks
- 688
- PR merge metrics
- No merged PRs in 30d
Description
although other style work, but the @page style did not work, i am trying to customize 50mm x 70mm papper it but its keep giving me default page sizze wich is A4 papper
```html
PrintJS
Cetak PDF
function printHtmlCustomStyle() {
const content = `
<div class="page">
<h1>Page 1</h1>
</div>
<div class="page">
<h1>Page 2</h1>
</div>
`;
const style = `
@page {
size: 50mm 70mm;
margin: 0;
}
@media print {
.page {
width: 50mm;
height: 70mm;
page-break-after: always;
border: 1px solid black;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-family: Arial, sans-serif;
color: blue;
}
}
`;
printJS({
printable: content,
type: 'raw-html',
style: style,
scanStyles: false
});
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.