Discussion:
[Exist-open] XSL-FO module eXist version 3.1
Winona Salesky
2017-06-07 02:46:50 UTC
Permalink
Hi All,
I am trying to get XSL-FO working with my eXist v 3.1 installation. (Was
working with 2.2, not sure about 3.0)

Test case:

xquery version "3.1";
declare namespace xslfo="http://exist-db.org/xquery/xslfo";

let $fo :=
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page">
<fo:region-body margin="0.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<fo:block>Test of Page</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
let $pdf := xslfo:render($fo, "application/pdf", ())
return response:stream-binary($pdf, "application/pdf", "output.pdf")

Error (when run in eXide):
Could not initialize class
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry

The XSLFO module has been enabled in conf.xml and in
$EXIST_HOME/extensions/build.properties

Any ideas?
Thanks,
-Winona
Hungerburg
2017-06-07 08:51:34 UTC
Permalink
Hello Winona,

the snippet works here in a recent git version; I had FO problems too;
don't remember exactly what I had to do though, probably its:

If you did an update over the existing ;) version, look into
extensions/modules/lib/, there may be stale xmlgraphics-commons, batik
or so JARS idling

Peter
Post by Winona Salesky
Hi All,
I am trying to get XSL-FO working with my eXist v 3.1 installation. (Was
working with 2.2, not sure about 3.0)
xquery version "3.1";
declare namespace xslfo="http://exist-db.org/xquery/xslfo";
let $fo :=
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page">
<fo:region-body margin="0.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<fo:block>Test of Page</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
let $pdf := xslfo:render($fo, "application/pdf", ())
return response:stream-binary($pdf, "application/pdf", "output.pdf")
Could not initialize class
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry
The XSLFO module has been enabled in conf.xml and in
$EXIST_HOME/extensions/build.properties
Any ideas?
Thanks,
-Winona
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
Winona Salesky
2017-06-07 13:17:21 UTC
Permalink
Thanks Peter,
What does it mean to have "stale xmlgraphics-commons, batik or so JARS
idling" and how should I address it?
Thanks!
-Winona
Post by Hungerburg
Hello Winona,
the snippet works here in a recent git version; I had FO problems too;
If you did an update over the existing ;) version, look into
extensions/modules/lib/, there may be stale xmlgraphics-commons, batik or
so JARS idling
Peter
Post by Winona Salesky
Hi All,
I am trying to get XSL-FO working with my eXist v 3.1 installation. (Was
working with 2.2, not sure about 3.0)
xquery version "3.1";
declare namespace xslfo="http://exist-db.org/xquery/xslfo";
let $fo :=
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page">
<fo:region-body margin="0.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<fo:block>Test of Page</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
let $pdf := xslfo:render($fo, "application/pdf", ())
return response:stream-binary($pdf, "application/pdf", "output.pdf")
Could not initialize class org.apache.xmlgraphics.image.l
oader.spi.ImageImplRegistry
The XSLFO module has been enabled in conf.xml and in
$EXIST_HOME/extensions/build.properties
Any ideas?
Thanks,
-Winona
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
Joe Wicentowski
2017-06-07 20:47:01 UTC
Permalink
Hi Winona,
What does it mean to have "stale xmlgraphics-commons, batik or so JARS idling" and how should I address it?
Check $EXIST_HOME/extensions/modules/lib for any cases of jars with
the same name but different versions. In eXist 3.2.0 (with only
default extensions enabled via extensions/build.properties), I have
the following jars in this directory:

avalon-framework-api-4.3.1.jar
avalon-framework-impl-4.3.1.jar
batik-all-1.8.jar
cssparser-0.9.5.jar
fontbox-1.8.5.jar
fop-2.1.jar
sac-1.3.jar
xmlgraphics-commons-2.1.jar

If you have any "stale" jars (previous versions) alongside these
current versions, delete them and restart eXist.

Joe
Winona Salesky
2017-06-08 01:40:54 UTC
Permalink
Thanks Joe! That makes sense. I have PDF generation working now. (Mostly)

I am now have trouble getting my fonts recognized, I think the path used in
the fop configuration file is the problem.
This used to work:

<fop *version*=*"1.0"*>
<renderers>
<renderer *mime*=*"application/pdf"*>
<fonts>
<directory>http://wwwb.library.vanderbilt.edu/resources/fonts
</directory>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
Error:
<exception>
<path>/db/apps/srophe/modules/pdf.xql</path>
<message>
exerr:ERROR unknown protocol: exist [at line 32, column 13]
</message>
</exception>


-Winona
Post by Joe Wicentowski
Hi Winona,
Post by Winona Salesky
What does it mean to have "stale xmlgraphics-commons, batik or so JARS
idling" and how should I address it?
Check $EXIST_HOME/extensions/modules/lib for any cases of jars with
the same name but different versions. In eXist 3.2.0 (with only
default extensions enabled via extensions/build.properties), I have
avalon-framework-api-4.3.1.jar
avalon-framework-impl-4.3.1.jar
batik-all-1.8.jar
cssparser-0.9.5.jar
fontbox-1.8.5.jar
fop-2.1.jar
sac-1.3.jar
xmlgraphics-commons-2.1.jar
If you have any "stale" jars (previous versions) alongside these
current versions, delete them and restart eXist.
Joe
Joe Wicentowski
2017-06-08 02:01:16 UTC
Permalink
Hi Winona,

I recall others reporting issues with FOP configuration files and font
directories in the upgrade to eXist 3.x, which itself upgraded to a
new version of FOP. You might try adopting the technique from the TEI
Publisher app:

http://gitlab.exist-db.org/tei-publisher/tei-publisher-app/blob/master/modules/config.xqm#L89-93

Joe
Post by Winona Salesky
Thanks Joe! That makes sense. I have PDF generation working now. (Mostly)
I am now have trouble getting my fonts recognized, I think the path used in
the fop configuration file is the problem.
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<directory>http://wwwb.library.vanderbilt.edu/resources/fonts</directory>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
<exception>
<path>/db/apps/srophe/modules/pdf.xql</path>
<message>
exerr:ERROR unknown protocol: exist [at line 32, column 13]
</message>
</exception>
-Winona
Post by Joe Wicentowski
Hi Winona,
Post by Winona Salesky
What does it mean to have "stale xmlgraphics-commons, batik or so JARS
idling" and how should I address it?
Check $EXIST_HOME/extensions/modules/lib for any cases of jars with
the same name but different versions. In eXist 3.2.0 (with only
default extensions enabled via extensions/build.properties), I have
avalon-framework-api-4.3.1.jar
avalon-framework-impl-4.3.1.jar
batik-all-1.8.jar
cssparser-0.9.5.jar
fontbox-1.8.5.jar
fop-2.1.jar
sac-1.3.jar
xmlgraphics-commons-2.1.jar
If you have any "stale" jars (previous versions) alongside these
current versions, delete them and restart eXist.
Joe
Winona Salesky
2017-06-08 13:29:17 UTC
Permalink
Thank you Joe,
That does solve the font problem.
-Winona
Post by Joe Wicentowski
Hi Winona,
I recall others reporting issues with FOP configuration files and font
directories in the upgrade to eXist 3.x, which itself upgraded to a
new version of FOP. You might try adopting the technique from the TEI
http://gitlab.exist-db.org/tei-publisher/tei-publisher-
app/blob/master/modules/config.xqm#L89-93
Joe
Post by Winona Salesky
Thanks Joe! That makes sense. I have PDF generation working now. (Mostly)
I am now have trouble getting my fonts recognized, I think the path used
in
Post by Winona Salesky
the fop configuration file is the problem.
<fop version="1.0">
<renderers>
<renderer mime="application/pdf">
<fonts>
<directory>http://wwwb.library.vanderbilt.edu/resources/fonts
</directory>
Post by Winona Salesky
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
<exception>
<path>/db/apps/srophe/modules/pdf.xql</path>
<message>
exerr:ERROR unknown protocol: exist [at line 32, column 13]
</message>
</exception>
-Winona
Post by Joe Wicentowski
Hi Winona,
Post by Winona Salesky
What does it mean to have "stale xmlgraphics-commons, batik or so JARS
idling" and how should I address it?
Check $EXIST_HOME/extensions/modules/lib for any cases of jars with
the same name but different versions. In eXist 3.2.0 (with only
default extensions enabled via extensions/build.properties), I have
avalon-framework-api-4.3.1.jar
avalon-framework-impl-4.3.1.jar
batik-all-1.8.jar
cssparser-0.9.5.jar
fontbox-1.8.5.jar
fop-2.1.jar
sac-1.3.jar
xmlgraphics-commons-2.1.jar
If you have any "stale" jars (previous versions) alongside these
current versions, delete them and restart eXist.
Joe
Peter Chiochetti
2017-06-07 08:51:13 UTC
Permalink
Hello Winona,

the snippet works here in a recent git version; I had FO problems too;
don't remember exactly what I had to do though, probably its:

If you did an update over the existing ;) version, look into
extensions/modules/lib/, there may be stale xmlgraphics-commons, batik
or so JARS idling

Peter
Post by Winona Salesky
Hi All,
I am trying to get XSL-FO working with my eXist v 3.1 installation. (Was
working with 2.2, not sure about 3.0)
xquery version "3.1";
declare namespace xslfo="http://exist-db.org/xquery/xslfo";
let $fo :=
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="my-page">
<fo:region-body margin="0.5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="my-page">
<fo:flow flow-name="xsl-region-body">
<fo:block>Test of Page</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
let $pdf := xslfo:render($fo, "application/pdf", ())
return response:stream-binary($pdf, "application/pdf", "output.pdf")
Could not initialize class
org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry
The XSLFO module has been enabled in conf.xml and in
$EXIST_HOME/extensions/build.properties
Any ideas?
Thanks,
-Winona
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...