Re: Why extra blank pages?

Hussein Shafie <[email protected]> Wed, 11 Jan 2017 12:48:28 +0100
Newsgroups gmane.text.xml.xfc.general
Message-ID <[email protected]>
On 01/11/2017 08:45 AM, Přemysl Š. wrote:
> Even when I delete all footers and headers, the problem isn't solved. RenderX XEP or Apache FOP don't do that. I don't process XSL-FO files, I use builded-in transformator in XSL Utility. Are you sure it couldn't be bug in your code?
>

At the very end of your doc.xslt, in your
<xsl:template match="text()">,
---
        <xsl:non-matching-substring>
          <xsl:value-of select="."/>
        </xsl:non-matching-substring>
---

prevents indent="no" in your <xsl:output method="xml" encoding="UTF-8" 
indent="no"/> from working.

I've replaced this by:
---
        <xsl:non-matching-substring>
          <xsl:value-of select="normalize-space(.)"/>
        </xsl:non-matching-substring>
---

The problem is solved now.

That's why I warned you in my previous email:
---
2) Do not let our tool process *indented* XSL-FO files (indented XSL-FO 
files are only useful when debugging). In some cases, our tool thinks 
that open lines are significant and generates empty paragraphs for them, 
hence extra empty pages.
---




> I've got one more problem. When I use:
>
> <fo:block text-align="center">
>       <fo:external-graphic top="10mm" width="165.4mm" height="66.5mm" left="22mm">
>         <xsl:attribute name="src">
>           <xsl:text>url(</xsl:text>
>           <xsl:value-of select="@img"/>
>           <xsl:text>)</xsl:text>
>         </xsl:attribute>
>       </fo:external-graphic>
> </fo:block>
>
> it works only in docx. Could you tell me, please, why?
>

I've added content-width="scale-down-to-fit" and it works OK in both ODT 
and DOCX. (width="165.4mm" height="66.5mm" specifies a *viewport* size 
and has no influence on the size of the image itself.)



Similar issue with another fo:external-graphic found in your docx.xslt:
---
          <fo:external-graphic content-width="8mm" padding-left="-11mm" 
padding-bottom="1mm" padding-right="3mm">
            <xsl:attribute name="src">
              <xsl:text>url(</xsl:text>
              <xsl:value-of select="$doc/offer/config/odrazka-velka/@img"/>
              <xsl:text>)</xsl:text>
            </xsl:attribute>
          </fo:external-graphic>
---

I've remove padding-left="-11mm". A negative value is not supported by 
OpenOffice/LibreOffice.




--> I've made a number of useful changes (e.g. xfc:tab-position done 
right) in your doc.xslt. Please compare this modified doc.xslt with your 
original doc.xslt.ORI.

Using this modified doc.xslt, I got (attached):

* doc.docx
* doc.odt
* doc.pdf (with FOP).

Just like you, I used XMLmind XSL Utility to create all the above 
(attached) files. Please make sure to use exactly the same conversion 
specifications to get similar results. See attached xslutil.conversions.




--> I spent 3 hours adapting your doc.xslt to our product. Normally, we 
never, ever, do this. I just wanted to be sure that your use case didn't 
reveal unknown bugs. This was *not* the case.

In the future, if you are still interested in using our product, please 
be kind enough to file formal bug reports and not a snapshot of your 
development environment (including a local copy of our software 
distribution!).

More information in "XMLmind XSL-FO Converter support policy, Writing a 
usable bug report", 
http://www.xmlmind.com/foconverter/support_policy.html#bug_report



--
XMLmind FO Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xfc-support