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 Balaji Loganathan <ba...@yahoo.com> on 2002/05/21 14:41:56 UTC

Supplying options in servlet

Hi,
 I'm trying to supply the option file "userconfig.xml"
to the servlet.In command line we give it as fop -c
userconfig.xml -xsl -xml -pdf
 But how we can supply this servlet.?This i'm trying
for adding addtional font.
  I tried to use the Options class but didn't
succeeded.Below is FopServlet snippet,. 
  -----
  File userConfigFile = new File(userconfig.xml);
  options = new Options(userConfigFile);
   Driver driver = new Driver(foFile, out);
   driver.setLogger(log);
   driver.setRenderer(Driver.RENDER_PDF);
  driver.getRenderer().setOptions(options); ??
  ------
Please correct me.
Regards
Balaji.


http://briefcase.yahoo.com.au - Yahoo! Briefcase
- Save your important files online for easy access!

Re: Supplying options in servlet

Posted by Balaji Loganathan <ba...@yahoo.com>.
Hi Tkachenko, 
  Thanks and thanks a lot,it works for me.
  I just added the line
Options options = new Options(new
File("userconfig.xml")); 
  before initializing Driver object in my servlet.Now
I can easily support multiple languages without
worrying abt Unicode.Arabic and Japenese worked for.Of
course I'm NOT hard coding.I'm supplying the app
language in a seperate XML file.
 Actually I placed all my
fo,xsl,xml,userconfig.xml,.ttf etc in Tomcat/bin
folder as it was the default folder that Servlet/Jsp
is looking for reading and writing file,Is there is
anyway to configure my Web.xml so that i make my
servlet/JSP to read/write at different location.
 Thanks again.
Regards
Balaji

--- Oleg Tkachenko <ol...@multiconn.com> wrote: >
Balaji Loganathan wrote:
> 
> >  I'm trying to supply the option file
> "userconfig.xml"
> > to the servlet.In command line we give it as fop
> -c
> > userconfig.xml -xsl -xml -pdf
> >  But how we can supply this servlet.?This i'm
> trying
> > for adding addtional font.
> >   I tried to use the Options class but didn't
> > succeeded.Below is FopServlet snippet,. 
> >   -----
> >   File userConfigFile = new File(userconfig.xml);
> You probably have to provide full path to the file.
> In a servlet you can parametrize it as follows:
> Options options = new Options(
> 	new
>
File(getServletConfig().getInitParameter("fop-config")));
> having in web.xml
> <init-param>
> 	<param-name>fop-config</param-name>
> 
>
<param-value>d:/fop/fop-0.20.3/conf/userconfig.xml</param-value>
> </init-param>
> 
> >   options = new Options(userConfigFile);
> That's it. You have added options this way. See 
>
http://marc.theaimsgroup.com/?l=fop-user&m=101481390006348&w=2
> 
> -- 
> Oleg Tkachenko
> Multiconn International, Israel
>  

http://briefcase.yahoo.com.au - Yahoo! Briefcase
- Save your important files online for easy access!

Re: Supplying options in servlet

Posted by Oleg Tkachenko <ol...@multiconn.com>.
Balaji Loganathan wrote:

>  I'm trying to supply the option file "userconfig.xml"
> to the servlet.In command line we give it as fop -c
> userconfig.xml -xsl -xml -pdf
>  But how we can supply this servlet.?This i'm trying
> for adding addtional font.
>   I tried to use the Options class but didn't
> succeeded.Below is FopServlet snippet,. 
>   -----
>   File userConfigFile = new File(userconfig.xml);
You probably have to provide full path to the file.
In a servlet you can parametrize it as follows:
Options options = new Options(
	new File(getServletConfig().getInitParameter("fop-config")));
having in web.xml
<init-param>
	<param-name>fop-config</param-name>
	<param-value>d:/fop/fop-0.20.3/conf/userconfig.xml</param-value>
</init-param>

>   options = new Options(userConfigFile);
That's it. You have added options this way. See 
http://marc.theaimsgroup.com/?l=fop-user&m=101481390006348&w=2

-- 
Oleg Tkachenko
Multiconn International, Israel


Re: view related data with each other

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Mohamed Abdel Hameed wrote:
> Hi
> my problem is that there is data on table
> some of tese data text and there is image related to this text
> sometime part of text appear at the last of the page and the rest appear in
> the next page with image
> for me i like to appear all data related with each other
> i mean no need for the part of data which appear in the last of the page
> i used break-after and break-before but in other places
> here situation is different
> anyone can help me
> 

As far as I can tell from this word soup, you want to have some
stuff kept together, like an image and the image caption, or
a headline and the first paragraph of the section.

Standard FO offers the keep-together, keep-with-next and
keep-with-previous properties for this purpose.
  http://www.w3.org/TR/xsl/slice7.html#keep-with-next

Unfortunately, these properties are not yet fully implemented
and work only on table rows. In order to get them to work,
you'll have to put the stuff that should be kept together
into a blind table.
   <fo:table table-layout="fixed" width="100%">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-body>
       <fo:table-row>
         <fo:table-cell>
           <fo:block><fo:external-graphic src="foo.jpg"/></fo:block>
         </fo:table-cell>
       </fo:table-row>
       <fo:table-row keep-with-previous="always">
         <fo:table-cell>
           <fo:block>Caption for Image</fo:block>
         </fo:table-cell>
       </fo:table-row>
     </fo:table-body>
   </fo:table>

(Untested)

J.Pietschmann


view related data with each other

Posted by Mohamed Abdel Hameed <mo...@imkenberg.net>.
Hi
my problem is that there is data on table
some of tese data text and there is image related to this text
sometime part of text appear at the last of the page and the rest appear in
the next page with image
for me i like to appear all data related with each other
i mean no need for the part of data which appear in the last of the page
i used break-after and break-before but in other places
here situation is different
anyone can help me