Re: fop v0.20 vs v0.95

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: fop v0.20 vs v0.95

by Stuart Rackham :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mikhail Yakshin wrote:

> Hello, Stuart,
>
> First, I'd like to thank you for your excellent AsciiDoc suite: I'm
> using it already for two of my project and I'm looking for more :)
>
> I was generating HTMLs using AsciiDoc for a while, and recently I've
> came up with a task of PDF generation. Looks like the best way to do
> so it using docbook->fo->pdf chain, but, alas, I've stumbled upon a
> long-lasting problem with .fo documents made by asciidoc toolchain
> (a2x) are not suitable for newer versions of Apache FOP v0.95, but
> compile okay using ancient versions (v0.20.*).
>
> I've seen you mentioning this problem on various forums/mailing lists:
> you wrote that you've got mystical unhandled Java exception and
> there's no way around it. In fact, after spending several hours of
> reading DocBook specifications and DocBook XSL, I've understood that
> it's pretty simple: DocBook XSLs have 2 parameters named
> "fop.extensions" and "fop1.extensions". You don't call DocBook XSLs
> directly, but propagate some default parameters using special "fo.xsl"
> stylesheet, distributed with AsciiDoc. The problem with fop v0.95
> compatibility can be easily solved by replacing "fop.extensions" with
> "fop1.extensions" in that file:
>
> -<xsl:param name="fop.extensions" select="1" />
> +<xsl:param name="fop1.extensions" select="1" />
>
> After that, I've successfully made it work with modern Apache FOP :)
>
> Hope it helps and new version of AsciiDoc would support newer FOP out
> of the box ;)
>

Thank you Mikhail for doing the hard stuff. I've verified it works on
fop-0.95 and have applied your patch:
http://hg.sharesource.org/asciidoc/rev/e1bc93fef523

I've also cc'd this to the asciidoc-discuss mailing list as I'm sure
others will be interested in this.

See also: http://xmlgraphics.apache.org/fop/0.95/upgrading.html

I also had to remove a line defining 'bgcolor' from ./docbook/common.xsl
with it in got the following FOP exception:

SEVERE: Exception
javax.xml.transform.TransformerException:
org.apache.fop.fo.ValidationException:
file:/home/srackham/projects/asciidoc/trunk/doc/asciidoc.fo:471:514:
Error(471/514): fo:block, Invalid property name 'bgcolor'.

This problem was alluded to in a previous post
http://www.mail-archive.com/asciidoc-discuss@.../msg00118.html

Some differences I've noticed between 0.20 and 0.95:

- FOP 0.20.5 scales images if they overflow page width, FOP 0.95beta
does not (./doc/music-filter.pdf).

I must say I'm leaning towards dblatex(1) to generate PDF's:

- dblatex is easy to install (on Linux)
- requires no configuration
- is blindingly fast
- one step conversion, docbook XML to PDF (no FO generation, no need for
XSL Stylesheets and patches, XSLT processing or Java).
- Internal document hyperlinks are implemented (this is really handy).
- The output documents are more compact with about 20% less pages.

The only drawback is that the output is quite plain -- anyone out there
with any dblatex styling experience?

I really need to clean up the FOP stuff in the user guide (FOP install
stuff doesn't really belong) and mention dblatex(1).


Cheers, Stuart
--
Stuart Rackham

_______________________________________________
asciidoc-discuss mailing list
asciidoc-discuss@...
http://lists.metaperl.com/cgi-bin/mailman/listinfo/asciidoc-discuss