@@ -185,8 +185,6 @@ private FopConfigWrap newFopWrap() throws ConfigException {
185185 }
186186 foUserAgent .setAccessibility ( this .isAccessibility () );
187187 foUserAgent .setKeepEmptyTags ( this .isKeepEmptyTags () );
188- foUserAgent .setProducer ( PRODUCER_DEFAULT );
189- foUserAgent .setCreator ( VenusVersion .VENUS_CREATOR );
190188 return new FopConfigWrap ( fopFactory , foUserAgent );
191189 }
192190
@@ -226,6 +224,11 @@ private void xsltDebugCheck( DocBase docBase, byte[] xslContent, Transformer tra
226224 }
227225 }
228226
227+ private void setupMetadata ( DocBase docBase , FOUserAgent foUserAgent ) {
228+ foUserAgent .setProducer ( StringUtils .valueWithDefault ( docBase .getInfoDocProducer (), PRODUCER_DEFAULT ) );
229+ foUserAgent .setCreator ( StringUtils .valueWithDefault ( docBase .getInfoDocCreator (), VenusVersion .VENUS_CREATOR ) );
230+ }
231+
229232 @ SuppressWarnings ("unchecked" )
230233 @ Override
231234 public void handle (DocInput docInput , DocOutput docOutput ) throws Exception {
@@ -235,7 +238,9 @@ public void handle(DocInput docInput, DocOutput docOutput) throws Exception {
235238 // the XML file which provides the input
236239 StreamSource xmlSource = new StreamSource ( new InputStreamReader ( input , this .getCharset () ) );
237240 FopConfigWrap fopWrap = this .fopWrapSupplier .get ();
238- Fop fop = fopWrap .getFopFactory ().newFop (MimeConstants .MIME_PDF , fopWrap .getFoUserAgent (), docOutput .getOs ());
241+ FOUserAgent foUserAgent = fopWrap .getFoUserAgent ();
242+ this .setupMetadata ( docBase , foUserAgent );
243+ Fop fop = fopWrap .getFopFactory ().newFop (MimeConstants .MIME_PDF , foUserAgent , docOutput .getOs ());
239244 TransformerFactory factory = TransformerXML .newSafeTransformerFactory ();
240245 Transformer transformer = this .newTransformer ( factory , docBase );
241246 this .xsltDebugCheck ( docBase , xslContent , transformer );
0 commit comments