You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Danushka Menikkumbura <da...@wso2.com> on 2009/07/01 13:20:09 UTC

HELP : Embedding Large Number of Lines from an External File

Hi all,

My .fo file expects some content from an external XML file. This file
contains large number of lines with indentation. When I get FOP to generate
a PDF file out of this, I can observe that it just includes the bottom part
of the XML file that can fit into a single page. FOP also igonores line
indentation. Please advise how I could get FOP to have the content from the
XML in multiple pages with indentation unchanged. Hope this could be solved
by some XML-FO trick.

Danushka

-- 
Danushka Menikkumbura
Technical Lead, WSO2 Inc.

blog : http://danushka-menikkumbura.blogspot.com/

http://wso2.com/ - "The Open Source SOA Company"

Re: HELP : Embedding Large Number of Lines from an External File

Posted by Danushka Menikkumbura <da...@wso2.com>.
Hi Andreas,

Its awesome!. Thank you so much for helping out solve my issues. Nice you
have explained the reason for the issues as well.

Thanks again ! :-)

Danushka

-- 
Danushka Menikkumbura
Technical Lead, WSO2 Inc.

blog : http://danushka-menikkumbura.blogspot.com/

http://wso2.com/ - "The Open Source SOA Company"

Re: HELP : Embedding Large Number of Lines from an External File

Posted by Andreas Delmelle <an...@telenet.be>.
On 03 Jul 2009, at 09:59, Danushka Menikkumbura wrote:

Hi Danushka

> Any chance you can try 0.95 and check if the issue persists?
>
> I switched to 0.94 due to some table formatting issue in 0.95 so  
> that it not an option.

OK. I just tried your sample with latest FOP Trunk, and it reproduces  
the issue, but...

<snip />
> <fo:block space-before.minimum="0.5em" space-before.optimum="1em"  
> space-before.maximum="2em" space-after.minimum="0.5em" space- 
> after.optimum="1em" space-after.maximum="2em"
> keep-together.within-column="always" id="ex.wsdl">
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here's what's bugging you. Specifying keep="always" on a block that  
does not fit into one page triggers this issue. (Note that keep-* are  
all inherited properties, so indirectly you're saying: keep this block  
and all of its descendants together within the same column)
Why precisely FOP decides to only retain the last part, is a question- 
mark for me at the moment, but removing that property suffices to have  
the content distributed over multiple pages.

Besides that:

> <fo:block space-before.minimum="0pt" space-before.optimum="6pt"  
> space-before.maximum="6pt" space-after.minimum="0pt" space- 
> after.optimum="6pt" space-after.maximum="6pt" font- 
> family="monospace" font-stretch="semi-condensed" text-align="start"  
> background-color="#F0F0F0" border-style="solid" border-width="1pt"  
> border-color="#A0A0A0" padding="0pt 6pt 0pt 6pt" margin="0pt" line- 
> stacking-strategy="font-height" linefeed-treatment="preserve" white- 
> space-collapse="false" wrap-option="wrap">

I added the property "white-space-treatment='preserve'" to retain the  
indentation. If you don't specify it, the indenting spaces will be  
suppressed because they a follow a preserved linefeed.

HTH!

Andreas


Andreas Delmelle
mailto:andreas.delmelle.AT.telenet.be
jabber: mandreas@jabber.org
skype: adlm0608

---


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: HELP : Embedding Large Number of Lines from an External File

Posted by Danushka Menikkumbura <da...@wso2.com>.
Hi Andreas,


> Any chance you can try 0.95 and check if the issue persists?


I switched to 0.94 due to some table formatting issue in 0.95 so that it not
an option.

Try to trim it down, then. Ideal would be the smallest possible FO that
> triggers the behavior.


Here we go ... also note that FOP does not preserve XML formatting when it
adds my content into the PDF.

<fo:block space-before.minimum="0.5em" space-before.optimum="1em"
space-before.maximum="2em" space-after.minimum="0.5em"
space-after.optimum="1em" space-after.maximum="2em"
keep-together.within-column="always" id="ex.wsdl">
<fo:block space-before.optimum="1em" space-before.minimum="0.8em"
space-before.maximum="1.2em" font-weight="bold" font-size="12pt"
hyphenate="false" space-after.minimum="0.4em" space-after.optimum="0.6em"
space-after.maximum="0.8em" color="#202020"
keep-with-next.within-column="always">Example 10. WSDL</fo:block>

<fo:block space-before.minimum="0pt" space-before.optimum="6pt"
space-before.maximum="6pt" space-after.minimum="0pt"
space-after.optimum="6pt" space-after.maximum="6pt" font-family="monospace"
font-stretch="semi-condensed" text-align="start" background-color="#F0F0F0"
border-style="solid" border-width="1pt" border-color="#A0A0A0" padding="0pt
6pt 0pt 6pt" margin="0pt" line-stacking-strategy="font-height"
linefeed-treatment="preserve" white-space-collapse="false"
wrap-option="wrap">

<?xml version="1.0"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  xmlns:tns="http://dummy.com/wsdl/demo/weather/service/"
  xmlns:ns0="http://dummy.com/xsd/SchemaTypes/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:map="http://dummy.com/mapping/"
  name="demo.weather.service.WeatherService"
  targetNamespace="http://dummy.com/wsdl/demo/weather/service/">

  <wsdl:types>
    <xsd:schema xmlns:map="http://dummy.com/mapping/"
      xmlns:ns0="http://dummy.com/xsd/SchemaTypes/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://dummy.com/xsd/SchemaTypes/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      elementFormDefault="qualified"
      targetNamespace="http://dummy.com/xsd/SchemaTypes/">

      <xsd:element name="p0" nillable="true" type="xsd:string"/>
      <xsd:element name="string_Response" nillable="true" type="xsd:int"/>

    </xsd:schema>
  </wsdl:types>

  <wsdl:message name="WeatherServiceRequest">
    <wsdl:part name="p0" element="ns0:p0"/>
  </wsdl:message>
  <wsdl:message name="WeatherServiceResponse">
    <wsdl:part name="response" element="ns0:string_Response"/>
  </wsdl:message>

  <wsdl:portType name="WeatherService">
    <wsdl:operation name="gettemp" parameterOrder="p0">
      <wsdl:input message="tns:WeatherServiceRequest"/>
      <wsdl:output message="tns:WeatherServiceResponse"/>
    </wsdl:operation>
  </wsdl:portType>

  <wsdl:binding name="WeatherService" type="tns:WeatherService">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
      style="document"/>

    <wsdl:operation name="gettemp">
      <map:java-operation name="hello"

signature="KExqYXZhL2xhbmcvU3RyaW5nOylMamF2YS9sYW5nL1N0cmluZzsasfdasdfasdfaqwW@
="/>
      <soap:operation
        soapAction="
http://dummy.com/wsdl/demo/weather/service/WeatherService

#hello#KExqYXZhL2xhbmcvU3RyaW5nOylMamF2YS9sYW5nL1N0cmluZzssdfasASDAfasdasAaa="

                    style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>

  </wsdl:binding>

  <wsdl:service name="JavaService">
    <wsdl:port name="WeatherService" binding="tns:WeatherService">
      <soap:address location="http://localhost:6070/Basic/WeatherService"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions>

</fo:block>
</fo:block>

Regards,
Danushka

-- 
Danushka Menikkumbura
Technical Lead, WSO2 Inc.

blog : http://danushka-menikkumbura.blogspot.com/

http://wso2.com/ - "The Open Source SOA Company"

Re: HELP : Embedding Large Number of Lines from an External File

Posted by Andreas Delmelle <an...@telenet.be>.
On 01 Jul 2009, at 20:00, Danushka Menikkumbura wrote:

>
> 0.94

Any chance you can try 0.95 and check if the issue persists?

>
> Well my .fo file is quite huge so that not possible to send it  
> over :-(.

Try to trim it down, then. Ideal would be the smallest possible FO  
that triggers the behavior.

Regards

Andreas

Andreas Delmelle
mailto:andreas.delmelle.AT.telenet.be
jabber: mandreas@jabber.org
skype: adlm0608

---


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: HELP : Embedding Large Number of Lines from an External File

Posted by Danushka Menikkumbura <da...@wso2.com>.
Which FOP version are you using? Can you perhaps send us the FO, so we can
> check on our end, and provide specific hints?
>

0.94

Well my .fo file is quite huge so that not possible to send it over :-(.

Thanks,
Danushka

-- 
Danushka Menikkumbura
Technical Lead, WSO2 Inc.

blog : http://danushka-menikkumbura.blogspot.com/

http://wso2.com/ - "The Open Source SOA Company"

Re: HELP : Embedding Large Number of Lines from an External File

Posted by Andreas Delmelle <an...@telenet.be>.
On 01 Jul 2009, at 13:20, Danushka Menikkumbura wrote:

Hi

> My .fo file expects some content from an external XML file. This  
> file contains large number of lines with indentation. When I get FOP  
> to generate a PDF file out of this, I can observe that it just  
> includes the bottom part of the XML file that can fit into a single  
> page. FOP also igonores line indentation. Please advise how I could  
> get FOP to have the content from the XML in multiple pages with  
> indentation unchanged. Hope this could be solved by some XML-FO trick.

Which FOP version are you using? Can you perhaps send us the FO, so we  
can check on our end, and provide specific hints?


Regards,

Andreas Delmelle
mailto:andreas.delmelle.AT.telenet.be
jabber: mandreas@jabber.org
skype: adlm0608

---


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org