flyingsaucerproject / flyingsaucer

XML/XHTML and CSS 2.1 renderer in pure Java
Other
2.02k stars 565 forks source link

Page size 3value fix #383

Closed jelinj8 closed 2 months ago

jelinj8 commented 2 months ago

I wanted to create a PDF for a label printer with landscape orientation AND a custom size which evidently isn't supported.

@page {
   size: 40mm 20mm landscape;
}

This is an attempt to fix that (+ fixed one typo in original code reporting error on incorrect parameter value).

I'm unable to test this properly right now with current version as I'm unable to compile the library with Java 17 (still using FS 9.4.1 with Java 1.8), but it compiled OK and works (with slight modifications for the old version), this is to get it fixed when I'll be able to upgrade and to give something back, thanks. Succesfully created portrait label on landscape paper 40x20mm...

jelinj8 commented 2 months ago

Tested on latest version - works label.pdf configured by

@page {
    margin: 0;
    size: 40mm 20mm landscape;
}
asolntsev commented 2 months ago

@jelinj8 Thanks for the PR. I've released FS 9.9.3 and added few tests.