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 Abhijit Junnare <ma...@yahoo.com> on 2003/12/04 22:46:05 UTC

White space problem and text wrapping problem

I am having two problems while generating a PDF. I am
using xsl to convert souce xml to PDF. 
Problem1:
I am having problem with line feed/carriage return.
The line feeds from the souce xml are being converted
to a single white space automatically. I would like to
ignore these line feeds meaning convert these line
feeds to zero width space.
I know that using linefeed-treatment would solve my
problem. But as per the FOP compliance page
linefeed-treatment is not supported.
Is there any way to get around this problem.

Problem 2:
I would like to keep some text on the sam eline. This
for example I have text string as "FirstName LastName"
and it appears somewhere in the source. Now if both
FirstName and LastName can fit in the same line I
would like to print them as such but if not then I
would like to print both FirstName and LastName
starting on the next line. I guess 
"wrap-option" property should help me with this. But I
am not able to get this to working. Am I missing
something here?

Thanks in advance
Abhi

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Re: Bug with keep-together?

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Abhijit Junnare wrote:
> As FOP has keep-together implemented only for table
> rows I am formatting some content in a table. Now I
> have different margins for first page and rest of the
> pages. I have some content which has keep-together set
> to always and it should print on first page if it fits
> in its entirety or should start on second page. It
> does exactly that but the problem lies with the table
> width. I have set the table-width for this
> keep-together table to be 100%.

That's a bug with percentage resolution rather than with
keep-toghether. The percentage is resolved with respect
to the area where the table starts and is not recalculated
if the table spills into an area with a different width.
The same happens with basically all other percentages,
including widths on comon blocks.

You just have to avoid spreading blocks whose width involves
calculating percentages over blocks with different area
widths.

J.Pietschmann


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


Addition: Bug with keep-together?

Posted by Abhijit Junnare <ma...@yahoo.com>.
This is how I am formatting the table used to
implement Keep Together

<fo:table width="100%"
space-before="{$ActualSpaceBefore}"
table-layout="fixed" >
  <fo:table-column/>
  <fo:table-body>
    <fo:table-row keep-together="always">
      <fo:table-cell>
	 <fo:block color="{$FontColorBase}"
line-height="{$LineHeightBase}" >

	<xsl:apply-templates/>
	</fo:block>
      </fo:table-cell>
    </fo:table-row>
  </fo:table-body>
</fo:table>


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Bug with keep-together?

Posted by Abhijit Junnare <ma...@yahoo.com>.
As FOP has keep-together implemented only for table
rows I am formatting some content in a table. Now I
have different margins for first page and rest of the
pages. I have some content which has keep-together set
to always and it should print on first page if it fits
in its entirety or should start on second page. It
does exactly that but the problem lies with the table
width. I have set the table-width for this
keep-together table to be 100%. I have 1in margins for
all sides on first page and 0.5in margins for the rest
of the pages. Now when the content is more than what
can be accommodated on the remaining part of the first
page, it prints to content on second page BUT it has
1.5 in margin on the right side. It is not exactly
margin but the table width is calculated as 100%
considering the 1in margins and so the rest of the
space on the right side is left blank when this table
is printed on the second page (0.5 in margin). 
I can say for sure that table width is calculated as
per the first page because except for this table the
content on second page has 0.5 in margin on all right
and left sides. So is this a bug? Should I specify the
table width something other than 100%?


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Re: Passing parameters from command line

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Abhijit Junnare wrote:
> I am using FOP and XSLT to generate PDF. I have about
> 10 parameters defined at the top level in the
> stylesheet.
> I am wondering how can I pass valus of these paramters
> to the stylesheet while executing FOP from command
> line. I know this is a newbee question. 

There is no way to pass parameters to the XSLT processors in the
FOP command line. You either have to run the XSL transformation
standalone
  http://xml.apache.org/fop/running.html#check-input
the run the resulting FO through FOP, or use your own wrapper.

J.Pietschmann


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


Passing parameters from command line

Posted by Abhijit Junnare <ma...@yahoo.com>.
I am using FOP and XSLT to generate PDF. I have about
10 parameters defined at the top level in the
stylesheet.
I am wondering how can I pass valus of these paramters
to the stylesheet while executing FOP from command
line. I know this is a newbee question. 
Thanks in advance for the help.

Thanks,
Abhi

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Re: White space problem and text wrapping problem

Posted by Abhijit Junnare <ma...@yahoo.com>.
Got it!
Thanks for ur help :)
--- Abhijit Junnare <ma...@yahoo.com> wrote:
> Thanks much!
> The wrapping problem is solved by using a
> non-breaking
> space. Which FAP should I exactly look for the first
> problem. COuld you send me the link pleas.e Will
> really appreciate.
> Thanks
> Abhi
> 

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Re: White space problem and text wrapping problem

Posted by Abhijit Junnare <ma...@yahoo.com>.
Thanks much!
The wrapping problem is solved by using a non-breaking
space. Which FAP should I exactly look for the first
problem. COuld you send me the link pleas.e Will
really appreciate.
Thanks
Abhi

--- "J.Pietschmann" <j3...@yahoo.de> wrote:
> Abhijit Junnare wrote:
> > Problem1:
> > I am having problem with line feed/carriage
> return.
> > The line feeds from the souce xml are being
> converted
> > to a single white space automatically. I would
> like to
> > ignore these line feeds meaning convert these line
> > feeds to zero width space.
> > I know that using linefeed-treatment would solve
> my
> > problem. But as per the FOP compliance page
> > linefeed-treatment is not supported.
> > Is there any way to get around this problem.
> 
> You have to convert the LW to zero width space
> before feeding
> it into FOP. If you generate the FO using XSLT,
> check the S&R
> templates in the XSL FAQ.
> 
> > Problem 2:
> > I would like to keep some text on the sam eline.
> This
> > for example I have text string as "FirstName
> LastName"
> > and it appears somewhere in the source. Now if
> both
> > FirstName and LastName can fit in the same line I
> > would like to print them as such but if not then I
> > would like to print both FirstName and LastName
> > starting on the next line. I guess 
> > "wrap-option" property should help me with this.
> But I
> > am not able to get this to working. Am I missing
> > something here?
> 
> I don't think wrap-option would be appropriate.
> Anyway,
> this can easily be solved by using a non-breaking
> space
> instead of the normal space between the words.
> 
> J.Pietschmann
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail:
> fop-user-help@xml.apache.org
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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


Re: White space problem and text wrapping problem

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Abhijit Junnare wrote:
> Problem1:
> I am having problem with line feed/carriage return.
> The line feeds from the souce xml are being converted
> to a single white space automatically. I would like to
> ignore these line feeds meaning convert these line
> feeds to zero width space.
> I know that using linefeed-treatment would solve my
> problem. But as per the FOP compliance page
> linefeed-treatment is not supported.
> Is there any way to get around this problem.

You have to convert the LW to zero width space before feeding
it into FOP. If you generate the FO using XSLT, check the S&R
templates in the XSL FAQ.

> Problem 2:
> I would like to keep some text on the sam eline. This
> for example I have text string as "FirstName LastName"
> and it appears somewhere in the source. Now if both
> FirstName and LastName can fit in the same line I
> would like to print them as such but if not then I
> would like to print both FirstName and LastName
> starting on the next line. I guess 
> "wrap-option" property should help me with this. But I
> am not able to get this to working. Am I missing
> something here?

I don't think wrap-option would be appropriate. Anyway,
this can easily be solved by using a non-breaking space
instead of the normal space between the words.

J.Pietschmann



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