You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Julian <ce...@yahoo.com> on 2005/10/20 06:43:26 UTC
Merging Pipeline Content into PDF
Hi,
I want to merge a static PDF into a PDF being
generated via XSL:FO and the FOP serializer. I first
considered calling the "PDF generating" pipeline from
another servlet and then merging the output with the
static PDF in Java. Unfortunately, I could not find
an efficient mechanism (the CLI appears to reload the
xconf...which would burden the request time and CPU).
Any suggestions on the best approach?
Thanks,
Julian
I am currently using Cocoon 2.1.2 with Java 5 on
Tomcat. Also, I was thinking of using iText for the
PDF merging via Java.
Live simply so others may simply live.
-Ghandi
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
-William of Occam
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Julian <ce...@yahoo.com>.
Bertrand,
Thanks for your help. I achieved the desired
functionality by using the java.net.URL and
HttpsURLConnection classes. The content is the merged
with my static PDFs via the iText library. I took a
look at the package you had suggested for merging, but
the iText library seemed to be a bit more ubiquitous.
Thanks again,
Julian
Live simply so others may simply live.
-Ghandi
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
-William of Occam
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 20 oct. 05, à 20:28, Julian a écrit :
> ...I was hoping for something in-memory that would not
> require network activity, but it seems there is no
> other easy way to access the Cocoon servlet via Java...
If it's on the same host, the "network" activity only happens in the IP
stack layers. I don't think the cost of doing this makes much
difference as compared to the cost of generating and merging the PDFs.
There might be a more direct way, but I wouldn't bother too much -
going HTTP also makes things more decoupled.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Julian <ce...@yahoo.com>.
Bertrand,
I was hoping for something in-memory that would not
require network activity, but it seems there is no
other easy way to access the Cocoon servlet via Java.
I will try out your suggestion and report back.
Thanks,
Julian
--- Bertrand Delacretaz <bd...@apache.org>
wrote:
>
> Le 20 oct. 05, à 17:39, Julian a écrit :
>
> > sorry, but I forgot the mention that I understand
> how
> > to merge the PDFs. I just need to figure out how
> to
> > trigger the pipeline so I can get the response for
> > merging.
>
> I'm not sure if I understand the problem, can't you
> simply do an HTTP
> request to Cocoon, to get the PDF that it generates?
>
> Using something like httpclient
> (http://jakarta.apache.org/commons/httpclient/) from
> java, or wget from
> the command-line, you can retrieve the output of a
> Cocoon pipeline via
> http.
>
> -Bertrand
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
>
>
Live simply so others may simply live.
-Ghandi
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
-William of Occam
__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 20 oct. 05, à 17:39, Julian a écrit :
> sorry, but I forgot the mention that I understand how
> to merge the PDFs. I just need to figure out how to
> trigger the pipeline so I can get the response for
> merging.
I'm not sure if I understand the problem, can't you simply do an HTTP
request to Cocoon, to get the PDF that it generates?
Using something like httpclient
(http://jakarta.apache.org/commons/httpclient/) from java, or wget from
the command-line, you can retrieve the output of a Cocoon pipeline via
http.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Julian <ce...@yahoo.com>.
sorry, but I forgot the mention that I understand how
to merge the PDFs. I just need to figure out how to
trigger the pipeline so I can get the response for
merging.
--- Julian <ce...@yahoo.com> wrote:
> Hi,
>
> Thanks alot for the input. Unfortunately, I have
> the
> a static PDF that needs to be merged with one
> dynamically created by a pipeline via XML
> (src)->XSLT
> (tranfromer)->FOP (serializer). Also, I need to
> access this content from a request being handled by
> another servlet...not the Cocoon servlet.
>
> The dilemma is how to trigger the pipeline to
> generate
> the content, then merge the output with a static
> PDF,
> and send to the outputstream. I was thinking I
> could
> forward the request, but that would only take care
> of
> the first requirement. I appreciate any
> suggestions.
>
> Regards,
> Julian
>
> --- Bertrand Delacretaz <bd...@apache.org>
> wrote:
>
> > Le 20 oct. 05, à 06:43, Julian a écrit :
> >
> > > ...I want to merge a static PDF into a PDF being
> > > generated via XSL:FO and the FOP serializer....
> >
> > Merging PDFs is a pure binary operation, I don't
> > think any of the tools
> > bundled with Cocoon will help with this.
> >
> > A good tool that I use for such operations is
> pdftk,
> >
> > http://www.accesspdf.com/pdftk/. It's a
> command-line
> > tool AFAIK, but
> > with some scripting you should be able to get it
> to
> > do what you want.
> >
> > -Bertrand
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail:
> > users-help@cocoon.apache.org
> >
> >
>
>
> Live simply so others may simply live.
>
> -Ghandi
>
> Pluralitas non est ponenda sine neccesitate.
> "Entities should not be multiplied unneccesarily"
>
> -William of Occam
>
>
>
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
>
> http://www.yahoo.com/r/hs
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
>
>
Live simply so others may simply live.
-Ghandi
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
-William of Occam
__________________________________
Yahoo! Music Unlimited
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Julian <ce...@yahoo.com>.
Hi,
Thanks alot for the input. Unfortunately, I have the
a static PDF that needs to be merged with one
dynamically created by a pipeline via XML (src)->XSLT
(tranfromer)->FOP (serializer). Also, I need to
access this content from a request being handled by
another servlet...not the Cocoon servlet.
The dilemma is how to trigger the pipeline to generate
the content, then merge the output with a static PDF,
and send to the outputstream. I was thinking I could
forward the request, but that would only take care of
the first requirement. I appreciate any suggestions.
Regards,
Julian
--- Bertrand Delacretaz <bd...@apache.org>
wrote:
> Le 20 oct. 05, à 06:43, Julian a écrit :
>
> > ...I want to merge a static PDF into a PDF being
> > generated via XSL:FO and the FOP serializer....
>
> Merging PDFs is a pure binary operation, I don't
> think any of the tools
> bundled with Cocoon will help with this.
>
> A good tool that I use for such operations is pdftk,
>
> http://www.accesspdf.com/pdftk/. It's a command-line
> tool AFAIK, but
> with some scripting you should be able to get it to
> do what you want.
>
> -Bertrand
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail:
> users-help@cocoon.apache.org
>
>
Live simply so others may simply live.
-Ghandi
Pluralitas non est ponenda sine neccesitate.
"Entities should not be multiplied unneccesarily"
-William of Occam
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Bertrand Delacretaz <bd...@apache.org>.
Le 20 oct. 05, à 06:43, Julian a écrit :
> ...I want to merge a static PDF into a PDF being
> generated via XSL:FO and the FOP serializer....
Merging PDFs is a pure binary operation, I don't think any of the tools
bundled with Cocoon will help with this.
A good tool that I use for such operations is pdftk,
http://www.accesspdf.com/pdftk/. It's a command-line tool AFAIK, but
with some scripting you should be able to get it to do what you want.
-Bertrand
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Merging Pipeline Content into PDF
Posted by Jean-Christophe Kermagoret <jc...@bluexml.org>.
Hello,
the PDF serializer will only help you to generate PDF from XSL-FO files.
It won't help you to merge PDF files.
Cocoon may help you to merge XSL-FO (not PDF) files but it doesn't seem
to be your case, does it ?
Jean-Christophe
Julian a écrit :
> Hi,
>
> I want to merge a static PDF into a PDF being
> generated via XSL:FO and the FOP serializer. I first
> considered calling the "PDF generating" pipeline from
> another servlet and then merging the output with the
> static PDF in Java. Unfortunately, I could not find
> an efficient mechanism (the CLI appears to reload the
> xconf...which would burden the request time and CPU).
> Any suggestions on the best approach?
>
> Thanks,
> Julian
>
>
> I am currently using Cocoon 2.1.2 with Java 5 on
> Tomcat. Also, I was thinking of using iText for the
> PDF merging via Java.
>
> Live simply so others may simply live.
>
> -Ghandi
>
> Pluralitas non est ponenda sine neccesitate.
> "Entities should not be multiplied unneccesarily"
>
> -William of Occam
>
>
>
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
BlueXML
Jean-Christophe Kermagoret
Directeur associé
jck@bluexml.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org