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 Manuel Mall <ma...@apache.org> on 2006/02/23 07:42:46 UTC

Re: Help needed for allowing spaces in PDF O/P using fop-0.91beta version

>
>
>
>
>
> Hi ,
>
> I tried some combinations as
>
> ExampleXML2FO.java +  MY_XML => OUT_FO
> The fop file which is generated put the image tag as
>
> <fo:external-graphic src="hdfclogo5.jpg" content-height="scale-to-fit"
> content-width="scale-to-fit"/>
>
> Now when I pass this fop to
> ExampleXML2PDF.java  + MY_XML + OUT_FO => MY_PDF
>
> or
>
> ExampleFO2PDF.java + OUT_FO => My_PDF
> In both the case the image size is not taken as aboslute size of image
> instead it shrinks since the tag don't mention the height and width.
> I also went through examples/fo/basic/images.fo but result was same..
> Also the Leading spaces are neglected/deleted in both the cases.
>
> Can you please let me know when can Leading spaces getting
> deleted/neglected bug in fop-0.91 beta can be fixed. as the Leading spaces
> works fine in fop 0.20.5
>

There are typically no timeframes for these types of problems as we are
all volunteers using our spare time to work on FOP. If it is a serious and
urgent problem for you your best option is to get in and fix it yourself.

Having said that the current version of FOP in the Subversion repository
has a fix which allows it to deal with non breaking spaces correctly. As a
work around you could download and build the current development version
of FOP and convert in your data, where you want to preserve white space
and linefeeds, any spaces to non breaking spaces (&#xa0;)

Manuel

>
> Regards,
> Nitin Shrivastava
> POLARIS SOFTWARE LAB Ltd.
> Indiana Business Center
> +91-22-56482255
>
>
>
>
>
>                       Jeremias Maerki
>                       <dev@jeremias-ma         To:
> fop-users@xmlgraphics.apache.org
>                       erki.ch>                 cc:
> nitin.shrivastava@polaris.co.in,
> vikram.gujar@polaris.co.in
>                                                Subject: Re: Help needed
> for allowing spaces in PDF
> O/P using fop-0.91beta
>                       02/21/2006 02:38         version
>                       PM
>
>
>
>
>
>
>
> On 21.02.2006 09:35:22 nitin.shrivastava wrote:
>> content-width="scale-to-fit" content-height="scale-to-fit"
>> for fo:external-graphic does not allow be to put the absolute size of
> image
>> ...
>
> Why do you think so? Have a look at the specification at
> http://www.w3.org/TR/xsl/slice6.html#fo_external-graphic
> and you'll see that this works. There are examples in
> examples/fo/basic/images.fo which demonstrate all the different property
> combinations. scale-to-fit causes the image to be scaled so it fits into
> the viewport box defined by the width and height properties.
>
>> Can you suggest any workaround to allow Leading spaces in my case ???
>
> If there was one, we would have given it. The only solution is to fix
> the problem in the source code. Sorry. You can try to work with
> start-indent or margin-left. It's not the same but maybe it helps in
> your case.
>
>>
>>
>>
>> Thanks & Regards,
>> Nitin Shrivastava
>> POLARIS SOFTWARE LAB Ltd.
>> Indiana Business Center
>> +91-22-56482255
>>
>>
>>
>>
>>
>>
>
>>                       Jeremias Maerki
>
>>                       <dev@jeremias-ma         To:
> fop-users@xmlgraphics.apache.org
>
>>                       erki.ch>                 cc:
> nitin.shrivastava@polaris.co.in
>
>>                                                Subject: Re: Help needed
> for allowing spaces in PDF O/P using fop-0.91beta
>>                       02/21/2006 01:15         version
>
>>                       PM
>
>>
>
>>
>
>>
>>
>>
>>
>> Nitin Shrivastava does not appear to be on the list so I put the mail
>> address in the CC.
>>
>> In addition to Manuel's reply I want to add something to the question
>> further down:
>>
>> If you want to have an image appear in a box of a certain size, use this
>> pattern:
>>
>> <fo:external-graphic width="5cm" height="4cm"
>> content-width="scale-to-fit" content-height="scale-to-fit" src="...."/>
>>
>> On 20.02.2006 12:54:30 Manuel Mall wrote:
>> > The white space handling for linefeed-treatment="preserve" is
>> currently
>> > not correct for fop trunk. Leading spaces are incorrectly deleted.
>> >
>> > Manuel
>> >
>> > On Monday 20 February 2006 19:17, nitin.shrivastava@polaris.co.in
> wrote:
>> > > Regards,
>> > > Nitin Shrivastava
>> > > POLARIS SOFTWARE LAB Ltd.
>> > > Indiana Business Center
>> > > +91-22-56482255
>> > > ---------------------------------------------------------------------
>> > >------------------------------------
>> > >
>> > > "LUCK is what happens when PREPARATION meets OPPORTUNITY"
>> > >
>> > >
>> > > ----- Forwarded by nitin.shrivastava/Polaris on 02/20/2006 04:45 PM
>> > > -----
>> > >
>> > >                       nitin.shrivastava
>> > >                                                To:      Jeremias
>> > > Maerki <de...@jeremias-maerki.ch> 02/20/2006 03:31         cc:
>> > > nitin.shrivastava@polaris.co.in, vikram.gujar@polaris.co.in PM
>> > >                Subject: Help needed for allowing spaces in PDF O/P
>> > > using fop-0.91beta version(Document link: nitin.shrivastava)
>> > >
>> > >
>> > >
>> > >
>> > > Hi,
>> > >
>> > > With FOP  0.91 beta version I was able to overlapp the data over
>> > > image. Now the problem I am facing is w.r.t the space in the XML
>> file
>> > > which is getting  ignored in PDF output .
>> > >
>> > > My XML data between tags is as shown below
>> > >
>> > > |--------------------------------------------------------------------
>> > > |--------------------------------------------------------------------
>> > > |-------|
>> > > |
>> > > |      AAAAAA     BBBBB           CCCCCC          DDDDDD
>> > >
>> > > EEEEEE                  |
>> > >
>> > > |     AAAAAA      BBBBB              4000000000000000000000041
>> > > |
>> > > |                                            00000
>> > > |
>> > > |--------------------------------------------------------------------
>> > > |--------------------------------------------------------------------
>> > > |-------|
>> > >
>> > > My XSL is
>> > >
>> > > <fo:simple-page-master master-name="cover" page-height="1090pt"
>> > > page-width="714.78pt" margin-top="0cm" margin-bottom="0cm"
>> > > margin-left="0cm" margin-right="0cm">
>> > > <fo:region-body margin-top="0cm" margin-bottom="0cm"
>> > > margin-left="0in" margin-right="0in"/>
>> > > <fo:region-after extent="0cm"/>
>> > > </fo:simple-page-master>
>> > > </fo:layout-master-set>
>> > > <fo:page-sequence master-reference="cover" >
>> > > <fo:flow flow-name="xsl-region-body" >
>> > > <fo:block-container>
>> > > <fo:block  font-family="monospace"  linefeed-treatment="preserve"
>> > > white-space-treatment="preserve" white-space-collapse="false" >
>> > > <xsl:apply-templates/>
>> > > </fo:block>
>> > > </fo:block-container>
>> > > </fo:flow>
>> > >
>> > > The PDF O/P that I get is
>> > >
>> > > |--------------------------------------------------------------------
>> > > |--------------------------------------------------------------------
>> > > |-------|
>> > > |
>> > > |AAAAAA     BBBBB           CCCCCC          DDDDDD
>> > >
>> > > EEEEEE                        |
>> > >
>> > > |AAAAAA      BBBBB             4000000000000000000000041
>> > > |
>> > > |00000
>> > > |
>> > > |--------------------------------------------------------------------
>> > > |--------------------------------------------------------------------
>> > > |-------|
>> > >
>> > > Here the sapce inbetween the data "AAAAA" ,"BBBBB" is maintained in
>> > > the output but the intial spaces are getting neglected which
>> > > we need to display in the PDF O/P.
>> > >
>> > > Can you please suggest me where am I making the mistake / or I need
>> > > to specify any addition property in the flow/block-container/or
>> block
>> > > level.
>> > > Or any other workaround to maintain these initial spaces at every
>> > > line as maintianed in the XML file.
>> > >
>> > > One more query the image which I am trying the display in the PDF
>> > > output is not kaing the absolute size as maintained .The XSL for the
>> > > image is as below
>> > > <xsl:template match="img">
>> > >   <fo:block-container position="absolute">
>> > >   <fo:block>
>> > >   <fo:external-graphic  content-height="348%"  src="{@src}"/>
>> > >   </fo:block>
>> > >   </fo:block-container>
>> > >   </xsl:template>
>> > >
>> > > Here if I dont specify the content-height it take its own default
>> > > value and displays the image with diminished size.Where as in FOP
>> > > 0.20.5 the command   <fo:external-graphic   src="{@src}"/>  used to
>> > > display the absoluete size of image ... Please suggest me what can I
>> > > do to dispaly the abolute
>> > > size as content-height="auto" does not work in 0.91 beta version....
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > Regards,
>> > > Nitin Shrivastava
>> > > POLARIS SOFTWARE LAB Ltd.
>> > > Indiana Business Center
>> > > +91-22-56482255
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >                       Jeremias Maerki
>> > >                       <dev@jeremias-ma         To:
>> > > nitin.shrivastava@polaris.co.in erki.ch>                 cc:
>> > >                                                Subject: Re: Help
>> > > needed !!! 02/10/2006 03:20
>> > >                       PM
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > I thought you couldn't use a block-container approach. And as I told
>> > > you before fo:float isn't implemented, yet. The latest version of
>> > > Apache FOP is 0.91beta
>> > > (http://xmlgraphics.apache.org/fop/download.html). It has some
>> > > improvements over 0.20.5 WRT fo:block-container. But fo:float needs
>> > > to be implemented, first.
>> > >
>> > > There are no free alternatives available. Apache FOP is the best
>> open
>> > > source XSL-FO implementation. You will have to use a commercial tool
>> > > if you can't solve it with Apache FOP or look for an alternative to
>> > > XSL-FO.
>> > >
>> > > On 10.02.2006 10:33:22 nitin.shrivastava wrote:
>> > > > Hi,
>> > > >
>> > > > Can you please suggest me is there any new FOP version available
>> > > > with the implementation
>> > > > of block-container or float to meet my requirement.
>> > > > Or please suggest me any free ware available to achieve the same.
>> > > >
>> > > > Regards,
>> > > > Nitin Shrivastava
>> > > > POLARIS SOFTWARE LAB Ltd.
>> > > > Indiana Business Center
>> > > > +91-22-56482255
>> > >
>> > > ---------------------------------------------------------------------
>> > >------------------------------------
>> > >
>> > > > "LUCK is what happens when PREPARATION meets OPPURTUNITY"
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >                       Jeremias Maerki
>> > > >                       <dev@jeremias-ma         To:
>> > >
>> > > nitin.shrivastava@polaris.co.in
>> > >
>> > > >                       erki.ch>                 cc:
>> > > >                                                Subject: Re: Help
>> > > > needed
>> > >
>> > > !!!
>> > >
>> > > >                       02/08/2006 12:40
>> > > >                       PM
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > >
>> > > > If my proposed work-arounds don't work, you can't do it with FOP
>> at
>> > > > the moment. You're welcome to help us implement support for
>> > > > fo:float, though. But since it's not an easy task you will
>> probably
>> > > > have to switch to another (commercial) FO implementation.
>> > > >
>> > > > On 08.02.2006 06:26:06 nitin.shrivastava wrote:
>> > > > > Hi ,
>> > > > >
>> > > > > I can't use both the options (block-container or in an fo:table
>> )
>> > > > > as it does not fit w,r,t my XML and XSL design.
>> > > > >
>> > > > > Can you please suggest me any way I can place/overlap image on
>> > > > > the data line..
>> > > > > Or please tell be do I need to use/shift to any new version of
>> > > > > FOP
>> > >
>> > > where
>> > >
>> > > > I
>> > > >
>> > > > > can overlap image over data
>> > > > > as I do in HTML.???
>> > > > >
>> > > > >
>> > > > > Thanks & Regards,
>> > > > > Nitin Shrivastava
>> > > > > POLARIS SOFTWARE LAB Ltd.
>> > > > > Indiana Business Center
>> > > > > +91-22-56482255
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >                       Jeremias Maerki
>> > > > >
>> > > > >                       <dev@jeremias-ma         To:
>> > > >
>> > > > fop-users@xmlgraphics.apache.org
>> > > >
>> > > > >                       erki.ch>                 cc:      (bcc:
>> > > >
>> > > > nitin.shrivastava/Polaris)
>> > > >
>> > > > >                                                Subject: Re: Help
>> > > > > needed
>> > > >
>> > > > !!!
>> > > >
>> > > > >                       02/02/2006 06:31
>> > > > >
>> > > > >                       PM
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > >
>> > > > > As you can see from the log output and on our compliance page
>> > > > > [1], fo:float is not available. Work-arounds include putting the
>> > > > > image in an absolutely positioned block-container or in an
>> > > > > fo:table (lines in the left cell, image in the right cell).
>> > > > >
>> > > > > [1]
>> > > > > http://xmlgraphics.apache.org/fop/compliance.html#fo-object-float
>> > > > >
>> > > > > On 02.02.2006 10:02:05 nitin.shrivastava wrote:
>> > > > > > Hi ,
>> > > > > >
>> > > > > > I am trying to create a PDF using the FOP converter ver
>> > > > > > 0.20.5.By
>> > > >
>> > > > passing
>> > > >
>> > > > > > an XML and XSL to it.
>> > > > > > Now in my XML there is Image in the frist line followed by
>> four
>> > > > > > empty
>> > > > >
>> > > > > line
>> > > > >
>> > > > > > and then data
>> > > > > > which is coming from the database.
>> > > > > > In my XSL i am using the following code to put the image
>> > > > > > <fo:inline>
>> > > > > > <fo:block>
>> > > > > > <fo:external-graphic   src="{@src}"/>
>> > > > > > </fo:block>
>> > > > > > </fo:inline>
>> > > > > >
>> > > > > > Here I am using absolute higth and width of image.
>> > > > > > In the output of the PDF I am getting the image pasted as it
>> > > > > > but the
>> > > >
>> > > > four
>> > > >
>> > > > > > empty
>> > > > > > lines are coming after the image .
>> > > > > > I want my image to overlap on these empty line since there is
>> > > > > > no data
>> > >
>> > > ,
>> > >
>> > > > > > even if the data is there I want my image to be placed on the
>> > > > > > side of
>> > > >
>> > > > it.
>> > > >
>> > > > > > i.e.
>> > > > > > currently my O/P is coming as :
>> > > > > >
>> > > > > > Line1 |-----------------------|
>> > > > > >
>> > > > > >       |  IMAGE    |
>> > > > > >       |
>> > > > > >       |
>> > > > > >       |-----------------------|
>> > > > > >
>> > > > > > Line2
>> > > > > > Line3
>> > > > > > Line4
>> > > > > > Line5
>> > > > > >
>> > > > > > And I want the O/P as
>> > > > > >
>> > > > > > Line1 |-----------------------|
>> > > > > > Line2 |  IMAGE    |
>> > > > > > Line3 |           |
>> > > > > > Line4 |           |
>> > > > > > Line5 |-----------------------|
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > >
>> > > > > > I tried using the float option to allow data on the side of
>> > > > > > image
>> > >
>> > > but
>> > >
>> > > > > > it gives me ...
>> > > > > >
>> > > > > > [DEBUG] The element 'fo:float' is not yet implemented.
>> > > > > > [INFO] [2]
>> > > > > > [DEBUG] The element 'fo:float' is not yet implemented.
>> > > > > > [INFO] [3]
>> > > > > > [DEBUG] The element 'fo:float' is not yet implemented.
>
>
>
> Jeremias Maerki
>
>
>
>
>
> This e-Mail may contain proprietary and confidential information and is
> sent for the intended recipient(s) only.
> If by an addressing or transmission error this mail has been misdirected
> to you, you are requested to delete this mail immediately.
> You are also hereby notified that any use, any form of reproduction,
> dissemination, copying, disclosure, modification,
> distribution and/or publication of this e-mail message, contents or its
> attachment other than by its intended recipient/s is strictly prohibited.
>
> Visit Us at http://www.polaris.co.in
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>



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