Hi Rolf,

Did you have a compiling issue or runtime error?

Please let us know more!
Please send error messages and stack trace, and a minimal reproducible
example!

Best regards, Csaba

Rolf Schumacher <r...@august.de> ezt írta (időpont: 2024. szept. 3., K,
18:40):

> Dear fop specialists,
>
> some time ago I used to use fop something like shown below (I hope the
> formatting stays constant).
>
> Now I was trying to do so with maven, Java-21 and fop 2.9 and failed.
>
> Is there an example program, e.g. on github, how to use fop 2.9, including
> the pom.xml and the module-info.java?
>
> =====
>
> FopFactoryBuilder builder = new FopFactoryBuilder(basePath.toUri())
>
> .setPageHeight("297mm")
>
> .setPageWidth("210mm");
>
> FopFactory fopFactory = builder.build();
>
> out = new BufferedOutputStream(Files.newOutputStream(r));
>
> Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out);
>
> Transformer transformer = TransformerFactory.newInstance().newTransformer
> ();
>
> Source src = new StreamSource(fo.toFile());
>
> Result res = new SAXResult(fop.getDefaultHandler());
>
> transformer.transform(src, res);
>
> out.close();
>
> =====
>
> mit freundlichen Grüße, Best Regards
>
> Rolf
>
>

Reply via email to