[xep-support] XEP/XML - Newline chars being eaten and logo not scaling

Alexander Peshkov peshkov at renderx.com
Tue Aug 26 01:12:13 PDT 2003


Hello Daniel,

1. To scale down image by height use the following code:

   <fo:external-graphic content-height="scale-to-fit"
                        height="3.19cm"
                        content-width="100%"
                        scaling="uniform"
                        src="url(....)"/>

   Note that image scaling technique was discussed on this list before
   - please use search utility at our site http://xep.xattic.com
   (Google search at the top of the main page).

2. I wasn't able to reproduce newlines problem that you experiencing
   using XEP 2.78 and 3.54. I suppose it has nothing to do with XEP
   itself but rather caused by different XSLT transformers (or their
   settings) used in a tool chain. In general line breaks treatment
   defined by the 'linefeed-treatment' property and its behavior
   hasn't changed since 2.78.
   Are you sure that input XSL FO documents are absolutely equal for
   2.78 and 3.54? If you feed the same FO document (cited below) to
   XEP 2.78 and 3.54 from command line does this 'newline eating'
   effect persists?
---------------------------------------------------------------------
<?xml version="1.0"?>
<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="1in"/>
                </fo:simple-page-master>
        </fo:layout-master-set>
        <fo:page-sequence master-reference="my-page">
                <fo:flow flow-name="xsl-region-body">
                  <fo:block linefeed-treatment="preserve">
                      Thanks for ordering our product.

                      We appreciate your business.
                  </fo:block>
                </fo:flow>
        </fo:page-sequence>
</fo:root>
---------------------------------------------------------------------

Best regards,
Alexander Peshkov                             mailto:peshkov at renderx.com
RenderX
   

DK> Currently I am using JDK 1.3.1 with XEP 3.54.  The system I am working on
DK> creates some dynamic XML and pushes it off to XEP to transform to PDF using
DK> an XSL sheet.  We were using JDK 1.3.1 with XEP 2.78.  Due to the newer
DK> version changing the API, I had to rewrite the code that called up XEP and
DK> transformed the XML document.  I am having two problems that I didn't have
DK> in the previous version.  Newline characters are being eaten and a logo at
DK> the top of the page isn't scaling properly.  Since the logo isn't scaling
DK> properly everytime sometimes it appears and sometimes it doesn't.  The XSL
DK> sheet hasn't been changed at all.  The code that I changed to work with the
DK> new version of XEP shouldn't have affected the output at all.  Therefore I
DK> am wondering why the older version didn't eat newline characters and the
DK> newer version does.   I compared the .FO file that is generated to the
DK> previous version and the latest version and nothing was different.  The XML
DK> generated is also the same.  As far as the logo goes here are code snippets:

DK> ========================================
DK>   <fo:block-container height="3.3cm" top="0.5cm" left="1.35cm" padding="0pt"
position="absolute">>
DK>     <fo:block/>
DK>       <xsl:apply-templates select="Logo"/>
DK>    </fo:block-container>

DK>   <xsl:template match="Logo">
DK>     <fo:block text-align="start">
DK>       <fo:external-graphic content-height="3.19cm" scaling="uniform">
DK>         <xsl:attribute name="src"><xsl:value-of select="concat('file:///',
@AbsolutePath)"/>></xsl:attribute>        
DK>       </fo:external-graphic>
DK>     </fo:block>
DK>   </xsl:template>
DK> =======================================
DK> I even tried changing the last code snippet to this since with the above
DK> code the logo wouldn't appear at all.  Now it appears sometimes and
DK> sometimes it doesn't.  The graphics are all different sizes.  And therefore
DK> I need to be able to scale them to fit in this one block that is absolute.

DK>  <xsl:template match="Logo">
DK>     <fo:block text-align="start">
DK>       <fo:external-graphic content-width="scale-to-fit" width="100%"
DK> content-height="100%" scaling="uniform">
DK>         <xsl:attribute name="src">url('<xsl:value-of
DK> select="concat('file:///', @AbsolutePath)"/>')</xsl:attribute>
        
DK>       </fo:external-graphic>
DK>     </fo:block>
DK>   </xsl:template>

DK> Example of newline chars being eaten:

DK> Old code:

DK>  Thanks for ordering our product.

DK>  We appreciate your business.

DK> New code:

DK>   Thanks for ordering our product.
DK>   We appreciate your business.


DK> If any other information would be helpful to include then please let me
DK> know.  I'm definitely befuddled as to what the deal is.  I've tried to even
DK> add <xsl:text>&#xA;</xsl:text> to put a newline character at the end of
DK> every paragraph.


DK> Thanks,
DK> Daniel W King
DK> Scientific Programmer II
DK> MDL Information Systems, Inc.
DK> (615) 366-2000x5114  
 

DK> -------------------
DK> (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
DK> in the body of the message to majordomo at renderx.com from the address
DK> you are subscribed from.
DK> (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html


-------------------
(*) To unsubscribe, send a message with words 'unsubscribe xep-support'
in the body of the message to majordomo at renderx.com from the address
you are subscribed from.
(*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



More information about the Xep-support mailing list