XSL-FO module eXist version 3.1

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

XSL-FO module eXist version 3.1

wsalesky
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: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
 

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

Hungerburg
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

Am 2017-06-07 um 04:46 schrieb 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)
>
> 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
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

Peter Chiochetti
In reply to this post by wsalesky
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

Am 2017-06-07 um 04:46 schrieb 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)
>
> 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
>
>
> ------------------------------------------------------------------------------
> 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
> [hidden email]
> 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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

wsalesky
In reply to this post by Hungerburg
Thanks Peter, 
What does it mean to have "stale xmlgraphics-commons, batik or so JARS idling" and how should I address it? 
Thanks!
-Winona


On Wed, Jun 7, 2017 at 4:51 AM, Hungerburg <[hidden email]> wrote:
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


Am 2017-06-07 um 04:46 schrieb 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)

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


------------------------------------------------------------------------------
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
[hidden email]
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
[hidden email]
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

Joe Wicentowski
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

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

wsalesky
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


On Wed, Jun 7, 2017 at 4:47 PM, Joe Wicentowski <[hidden email]> wrote:
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


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

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
Publisher app:

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

Joe

On Wed, Jun 7, 2017 at 9:40 PM, Winona Salesky <[hidden email]> wrote:

> 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
>
>
> On Wed, Jun 7, 2017 at 4:47 PM, Joe Wicentowski <[hidden email]> wrote:
>>
>> 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
>
>

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

wsalesky
Thank you Joe, 
That does solve the font problem. 
-Winona

On Wed, Jun 7, 2017 at 10:01 PM, Joe Wicentowski <[hidden email]> wrote:
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

On Wed, Jun 7, 2017 at 9:40 PM, Winona Salesky <[hidden email]> wrote:
> 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
>
>
> On Wed, Jun 7, 2017 at 4:47 PM, Joe Wicentowski <[hidden email]> wrote:
>>
>> 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
>
>


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: XSL-FO module eXist version 3.1

sunxinpeng
This post has NOT been accepted by the mailing list yet.
Hello, I have the same problem about font, just like yours.

I want to know how did you fix it?
Thanks in advance.
Loading...