Movatterモバイル変換


[0]ホーム

URL:


 

Apache XML Graphics Project Logo

Apache™ FOP

The Apache FOP Project

The Apache™ FOP Project

Upgrading from an Earlier Version of Apache™ FOP

Upgrading from Version 1.1

When upgrading from 1.x or earlier version of fop there are some significant changes that the user must be aware of:

FOUriResolver and FOPFactoryConfigurator classes have been removed

In their place, the following classes have been added:

Instead of configuring the FOPFactory you can use the above classes:

Filexconf=newFile("fop.xconf");FopConfParserparser=newFopConfParser(xconf);//parsing configurationFopFactoryBuilderbuilder=parser.getFopFactoryBuilder();//building the factory with the user optionsFOPFactoryfopFactory=builder.build();Fopfop=fopFactory.newFop(MimeConstants.MIME_PDF,foUserAgent,out);

or equally reading from an xml file

DefaultConfigurationBuildercfgBuilder=newDefaultConfigurationBuilder();Configurationcfg=cfgBuilder.buildFromFile(newFile("mycfg.xml"));fopFactoryBuilder=newFopFactoryBuilder(baseURI).setConfiguration(cfg);

The above can be used instead of fopFactory.setUserConfig(cfg) which is not available anymore.

Another important change is the way FOP resolves URI.Class FOURIResolver has been replaced with InternalResourceResolver (holds a reference to both the ResourceResolver needed for resource acquisition and the base URI from which to resolve URI's).ResourceResolverFactory (a factory class for Resource resolver).

Use of custom resource resolvers is now available through the use of FopFactoryBuilder.

FopFactoryBuilderbuilder=newFopFactoryBuilder(newFile(".").toURI(),resolver);

resolver is an object of org.apache.xmlgraphics.io.ResourceResolver.

Instead of fopFactory.setURIResolver(uriResolver); where uriResolver is an object of URIResolver.

More information on how to configure Apache FOP programmatically and customizing the User Agent can be found inembedding

Moreover more information on providing org.apache.xmlgraphics.io.ResourceResolver for custom URI resolution can be found inservlets

Upgrading from Version 1.0

You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following:

Upgrading from Pre-1.0 Versions

If you're planning to upgrade to the latest Apache™ FOP version from a pre-1.0 version, there are a few very important things to consider:

When you use your existing FO files or XML/XSL files which work fine with FOP version 0.20.5 against this FOP version some things may not work as expected. The following list will hopefully help you to identify and correct those problems.

Apache Software Foundation

Copyright © 2025 The Apache Software Foundation, Licensed undertheApache License, Version 2.0.
Apache, Apache XML Graphics, Apache FOP, Apache Batik, the Apache logo, and theApache XML Graphics logos are trademarks ofThe ApacheSoftware Foundation. All other marks mentioned may be trademarks or registeredtrademarks of their respective owners.


[8]ページ先頭

©2009-2026 Movatter.jp