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 Stuart Scott <St...@countrywide.co.uk> on 2010/10/25 12:06:11 UTC

Calling FOP from a non Java based webpage

I have been using various versions of FOP over the last few years at
command line level to create PDF's from XSL:FO.

 

I am not a Java programmer, but I am faced with the challenge of
creating a link inside a web page to call FOP, generate the PDF and
present to the browser either for viewing, printing or for the user to
save.

 

The web pages will be classic ASP using JavaScript, VBScript, XHTML and
XSLT. 

 

What would be the smartest way to achieve this?  Using Cocoon? Calling a
Java Servlet using AJAX?  I don't want to use .NET if possible.

 

Any ideas or opinions would be greatly appreciated.

 

Kind regards

 

Stuart Scott

For email disclaimer details please click or visit - http://www.countrywideplc.co.uk/disclaimer

Re: Calling FOP from a non Java based webpage

Posted by Stephan V Bechtolsheim <sv...@yahoo.com>.
That's really not an FOP issue.

Let's say you write a script xx.bat as follows:
echo 'I have fun' > xx.txt
and you are able to display xx.txt in a WEB page
then to execute FOP and to display its resulting PDF file
is probably not such a big step anymore - yes, obviously, there is the
issue of then having to render a PDF file.

I am NOT saying it's not a valid question and I am also not implying that
no one on the mailing list knows the answer - all I am saying is that this
mailing list is probably not the best forum to ask the question in.

StvB
 




________________________________
From: Stuart Scott <St...@countrywide.co.uk>
To: fop-users@xmlgraphics.apache.org
Sent: Mon, October 25, 2010 5:06:11 AM
Subject: Calling FOP from a non Java based webpage

 
I have been using various versions of FOP over the last few years at command 
line level to create PDF’s from XSL:FO.

RE: Calling FOP from a non Java based webpage

Posted by Stuart Scott <St...@countrywide.co.uk>.
That's basically what I was looking for.

Many thanks for your response, I will give this a try and see how I get
on.

Kind regards
 
Stuart Scott 

-----Original Message-----
From: Ognjen Blagojevic [mailto:ognjen.d.blagojevic@gmail.com] 
Sent: 26 October 2010 09:28
To: fop-users@xmlgraphics.apache.org
Subject: Re: Calling FOP from a non Java based webpage

> What would be the smartest way to achieve this? Using Cocoon? Calling
a
> Java Servlet using AJAX? I don't want to use .NET if possible.

I would suggest doing it inside simple Java web application with one 
servlet for generating PDF response using FOP, running on Apache Tomcat 
(or similar lightweight servlet container).

That way you will avoid creating instance of new Java Virtual Machine 
every time you need to create PDF, but use one instance (with 
configurable number of threads) for all of them.

You really don't need AJAX for that, since your servlet would generate a

full PDF document for every response. We use AJAX for generating data 
that are not considered full documents but rather HTML document parts or

data for populating form controls.

Depending of the usage, your Java web application may read external data

(if any) directly from data source (e.g. database) or from HTTP get/post

method parameters coming from the user.

If authentication is not a concern, you may expose links to your Java 
web application directly from your ASP application. If it is, than your 
ASP application will do the authentication and act as proxy to Java
webapp.

-Ognjen

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


For email disclaimer details please click or visit - http://www.countrywideplc.co.uk/disclaimer

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


Re: Calling FOP from a non Java based webpage

Posted by Ognjen Blagojevic <og...@gmail.com>.
> What would be the smartest way to achieve this? Using Cocoon? Calling a
> Java Servlet using AJAX? I don’t want to use .NET if possible.

I would suggest doing it inside simple Java web application with one 
servlet for generating PDF response using FOP, running on Apache Tomcat 
(or similar lightweight servlet container).

That way you will avoid creating instance of new Java Virtual Machine 
every time you need to create PDF, but use one instance (with 
configurable number of threads) for all of them.

You really don't need AJAX for that, since your servlet would generate a 
full PDF document for every response. We use AJAX for generating data 
that are not considered full documents but rather HTML document parts or 
data for populating form controls.

Depending of the usage, your Java web application may read external data 
(if any) directly from data source (e.g. database) or from HTTP get/post 
method parameters coming from the user.

If authentication is not a concern, you may expose links to your Java 
web application directly from your ASP application. If it is, than your 
ASP application will do the authentication and act as proxy to Java webapp.

-Ognjen

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