Re: PDF build error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: PDF build error

Guillaume Gardet
Hi,

Le 24/11/2011 10:44, Thomas Schraitle a écrit :

> Hi Guillaume,
>
> (should go to the mailinglist too)
>
> sorry for the delay.
>
> On Tuesday 22 November 2011 Guillaume Gardet wrote:
>> [...]
>> I tried to build HTML doc (no problem) and PDF doc but I get a bunch of
>> errors with PDF build. Full error log can be found here:
>> http://guillaume.gardet.free.fr/tmp/log.txt
>>
>> I used those commands to build:
>> daps --envfile=ENV-opensuse-all dist-html
>> daps --envfile=ENV-opensuse-all color-pdf
> That's correct, but you can also build separate guides. This is probably a bit
> more convenient and faster to build. :)
yes ! :) It is the tunig PDF which fails. Others are fine (except opensuse-all, of course).

>
>
>> Any idea how to solve the problem?
>>
>> Here is the beginning of the error log, it seems daps cannot find some
>> fonts:
> It's not daps, it's FOP. Just to be sure: do you have the correct FOP version
> installed? I have:
>
> $ rpm -q xmlgraphics-fop
> xmlgraphics-fop-1.0-11.noarch
xmlgraphics-fop-1.0-12.1.3.noarch
>
> Furthermore, daps should come with some dependencies on font packages. It
> probably doesn't hurt to check if you have the freefont and dejavu packages
> installed:
>
> $ rpm -q freefont dejavu
> freefont-0.20101118-4.4.noarch
> dejavu-2.32-2.1.noarch
freefont-0.20110523-4.1.3.noarch
dejavu-2.33-4.1.1.noarch

>
>> [...]
>>
>> ***** CSSEngine: exception....
>> Nov 22, 2011 10:05:01 AM org.apache.fop.events.LoggingEventListener
>> processEvent SEVERE: SVG error:
>> file:/home/guillaume/perso/opensuse-doc_svn/svn-berlios/en/build/.tmp/:
>> The attribute "font-family" represents an invalid CSS value
>> ("FreeSans,DejaVuSans,suse.sans"). Original message:
>> Unexpected token: 7 (see LexicalUnits).
> Just to give you some background information:
> Well, the attribute font-family can hold several alternative font names
> separated by comma. A FO formatter can be configured in such a way that it
> goes through a list of fonts to find a certain glyph. If the glyph is not
> available, the formatter will try the second font in the list and so on.
> As fonts usually do not have all glyphs, you can add "fallback alternatives"
> to make the selection a bit more reliable.
>
> In former times, FOP couldn't parse that nor was it able to create such
> correct fallback alternatives. The above error indicates that. However, I'm
> not sure if this is still the case, I think it should be fixed now.
>
> For the time being, you could try the following (untested):
>
> 1. Open /usr/share/daps/xslt/common/l10n/fr.xml and find the key
> "fop1.sans.font.family". You should see something like this:
>    <l:gentext key="fop1.sans.font.family"
> text="FreeSans,DejaVuSans,suse.sans"/>
>
> 2. Choose only one (FreeSans or DejaVuSans) and save it.
>
> 3. Clean up your working directory and rebuild your book.
>
> Of course, the changes will be overwritten by the next version.
>
> I expect to work on the stylesheets next week again to fix some problems. Will
> probably release some daps updates, too.
>
It helps for the CSS error be I get lots of errors like this one :
************************************************************************
org.w3c.dom.DOMException: The current document is unable to create an element of the requested type (namespace: http://www.w3.org/2000/svg, name: flowRoot).
         at org.apache.batik.dom.AbstractNode.createDOMException(Unknown Source)
         at org.apache.batik.dom.svg.SVGDOMImplementation.createElementNS(Unknown Source)
         at org.apache.batik.dom.svg.SVGOMDocument.createElementNS(Unknown Source)
         at org.apache.batik.dom.util.SAXDocumentFactory.startElement(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
         at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
         at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
         at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createSVGDocument(Unknown Source)
         at org.apache.fop.image.loader.batik.PreloaderSVG$Loader.getImage(PreloaderSVG.java:122)
         at org.apache.fop.image.loader.batik.PreloaderSVG$Loader.access$100(PreloaderSVG.java:105)
         at org.apache.fop.image.loader.batik.PreloaderSVG.preloadImage(PreloaderSVG.java:73)
         at org.apache.xmlgraphics.image.loader.ImageManager.preloadImage(ImageManager.java:175)
         at org.apache.xmlgraphics.image.loader.cache.ImageCache.needImageInfo(ImageCache.java:128)
         at org.apache.xmlgraphics.image.loader.ImageManager.getImageInfo(ImageManager.java:122)
         at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:81)
         at org.apache.fop.fo.FObj.processNode(FObj.java:123)
         at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:282)
         at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:171)
         at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
         at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
         at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
         at org.apache.xerces.xinclude.XIncludeHandler.emptyElement(Unknown Source)
         at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
         at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
         at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
         at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
         at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299)
         at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
         at org.apache.fop.cli.Main.startFOP(Main.java:174)
         at org.apache.fop.cli.Main.main(Main.java:204)
************************************************************************


Which JVM/JRE do you use to build the doc? I am using openJDK.


Please note that the following generates a PDF without error:
daps --envfile=ENV-opensuse-kvm color-pdf
daps --envfile=ENV-opensuse-reference color-pdf
daps --envfile=ENV-opensuse-security color-pdf
daps --envfile=ENV-opensuse-startup color-pdf

Last request, it cannot find "productname" nor "productnamereg" in html and pdf, so it generates empty productname and I get "Documentation de" (french for "Documentation of") without "openSUSE", just a blank. Where could it come from?

Guillaume

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: PDF build error

Thomas Schraitle-3
Hi Guillaume,

> Le 24/11/2011 10:44, Thomas Schraitle a écrit :
> [...]
> > $ rpm -q xmlgraphics-fop
> > xmlgraphics-fop-1.0-11.noarch
> xmlgraphics-fop-1.0-12.1.3.noarch

Looks good.


> > $ rpm -q freefont dejavu
> > freefont-0.20101118-4.4.noarch
> > dejavu-2.32-2.1.noarch
> freefont-0.20110523-4.1.3.noarch
> dejavu-2.33-4.1.1.noarch

Also ok.


> [...]
> >
> >
> It helps for the CSS error be I get lots of errors like this one :
> ************************************************************************
> org.w3c.dom.DOMException: The current document is unable to create an
> element of the requested type (namespace: http://www.w3.org/2000/svg,
> name: flowRoot). at
> org.apache.batik.dom.AbstractNode.createDOMException(Unknown Source)
> at

It seems the above error is caused by a "strange" SVG graphic.


> Which JVM/JRE do you use to build the doc? I am using openJDK.
 
Me too on openSUSE 12.1:

$ java -version
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.4) (suse-1.2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)


> Please note that the following generates a PDF without error:
> daps --envfile=ENV-opensuse-kvm color-pdf
> daps --envfile=ENV-opensuse-reference color-pdf
> daps --envfile=ENV-opensuse-security color-pdf
> daps --envfile=ENV-opensuse-startup color-pdf

That's a good tip! It was the Tuning Guide which does not build. After
some investigation, it's the cgroups1.svg graphic to blame.

If you save a SVG graphic as normal "Inkscape SVG" it introduces
strange "-inkscape-bla" attributes which causes this error. You have to
explicitly save it as "Plain SVG" to avoid such attributes. I mention
it so you can avoid such problems. It hit me in the past sometimes. ;)

I've committed the fixed SVG and it builds now. However, the graphic
looks garbled...

 
> Last request, it cannot find "productname" nor "productnamereg" in
> html and pdf, so it generates empty productname and I get
> "Documentation de" (french for "Documentation of") without
> "openSUSE", just a blank. Where could it come from?

I will look into this.

--
Gruß/Regards,
    Thomas Schraitle

----------------------------------------------------------------------
SUSE LINUX Products GmbH     (o<  
Maxfeldstrasse 5             /\\      Documentation Specialist
90409 Nuernberg, Germany    _\_v      http://www.suse.com
http://lizards.opensuse.org/author/thomas-schraitle/
SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild,
Felix Imendörffer, HRB 21284 (AG Nürnberg)
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]