Apache OpenOffice (AOO) Bugzilla – Issue 33065
docbook output produces empty width for inlinegraphics
Last modified: 2009-07-20 14:40:31 UTC
When saving a document in docbook xml, imgaes are saved as <inlinegraphic fileref="myimage.png" width=""/> This causes probelms when further processing the xml as then the width becomes "NAN" and this in not well handled by programs. The cause of the problem is in '/share/xslt/docbook/sofftodocbookheadings.xsl' at the very bottom in '<xsl:template match="draw:image">'. I am far from beeing an openoffice expert, but wouldn't it be possible to set the correct sizes here, from the graphic-formating dialog, cropping tab, scaling (the names might be wrong as I use the german version - grafik/zuschneiden/skalierung)
reassigned to JSI.
lo: If there's time we want to improve the quality.
I have taken a closer look at the issue. That is a exmaple XML fragment for a graphical element: <draw:image draw:style-name="fr1" draw:name="Grafik1" text:anchor-type="paragraph" svg:width="0.85cm" svg:height="0.85cm" draw:z-index="0" xlink:href="#Pictures/1000000000000040000000409DF66393.png" xlink:type="simple" xlink:show="embed" xlink:actuate="onLoad"/> and here is the related style: <style:style style:name="fr1" style:family="graphics" style:parent-style-name="Graphics"> <style:properties style:wrap="right" style:number-wrapped-paragraphs="no-limit" style:wrap-contour="false" style:horizontal-pos="left" style:horizontal-rel="paragraph" style:mirror="none" fo:clip="rect(0cm 0cm 0cm 0cm)" draw:luminance="0%" draw:contrast="0%" draw:red="0%" draw:green="0%" draw:blue="0%" draw:gamma="1" draw:color-inversion="false" draw:transparency="0%" draw:color-mode="standard"/> </style:style> The first problem is, that the size of the image is stored as svg:width and svg:height. 1.) the image is not a svg and 2.) the original size is missing or the resulting scale is missing. As a XSLT processor is not good in doing math this is very unfortunate. The second problem is that at least style:horizontal-pos="left|center|right" should be translated to align="left|center|right" of the docbook inlinegraphic element. See (http://www.docbook.org/tdg/en/html/inlinegraphic.html). Same applies to the docbook valign atribute.
xmlfilter for you
see also Issue 32792 and Issue 27424
svg:width is just a borrowed attribute from the svg specification. I used svg:width to fill width and svg:height to fill depth Please correct me if I am wrong, I just read http://www.sslug.dk/dokumentation/docbook/r01r109.html
Fixed in CWS XSLTFILTER08 according to my previous comment. Therefore the width is no longer empty. As testdocument you might resue "haandbog-1-1-0" from i30494.
Postponed to next release as there were too many CWS/issues waiting for the OOo 2.3 release to be integrated
seen good in cws xsltfilter08 set to verified inlinegraphic is no embedded as in the following example <inlinegraphic fileref="embedded:Grafik116" width="7.057cm" depth="2.045cm"/>
This issue is closed automatically and wasn't rechecked in a current version of OOo. This fixed issue should be integrated in OOo since more than half a year. If you think this issue isn't fixed in a current version (OOo 3.1), please reopen it and change the field 'Target Milestone' accordingly. If you want to download a current version of OOo => http://download.openoffice.org/index.html If you want to know more about the handling of fixed/verified issues => http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues