You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by ramlael <gr...@gmail.com> on 2011/07/07 14:32:55 UTC

Generate PDF

Hi Friends,

I have requirement need to generate pdf with string data which is in byte
stream and need to open in new window (pop up).  I have used below code ,
but its displaying in same window, not in pop up.. please can you help me on
this.

  public void downloadPdf(RequestCycle requestCycle, final String
eStatement, String filename) {
       
        final WebResponse webResponse = (WebResponse)
requestCycle.getResponse();
        webResponse.setContentType("APPLICATION/PDF");
        webResponse.setHeader("Content-Disposition", "inline; filename=\"" +
filename + "\"");
        requestCycle.setRequestTarget(new IRequestTarget() {
            
            public void respond(RequestCycle requestCycle) {
                try {

                    OutputStream stream = webResponse.getOutputStream();
                    OutputStreamWriter writer = new
OutputStreamWriter(stream, "ISO-8859-1");
                    writer.write(eStatement);
                   writer.flush();
                    writer.close();
                } catch (IOException ex) {
                    ex.printStackTrace();
                }
            }

            public void detach(RequestCycle requestCycle) {
            }

        });
    }
  

Thanks in advance
Rambabu

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3651354.html
Sent from the Users forum mailing list archive at Nabble.com.

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


SV: Generate PDF

Posted by Tron Walseth <tr...@telespor.no>.
Hi

I use Apache PDFBox for PDF generation on our site, in conjunction with Wicket. This works as a charm, but i haven't tried it with large documents. 

Yours, 
Tron
________________________________________
Fra: Abigail [abigailklinton@yahoo.com]
Sendt: 23. desember 2013 07:38
Til: users@wicket.apache.org
Emne: Re: Generate PDF

Hi there
I am a beginner of PDF processing .And i am looking for a  PDF processing
<http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/>
program.I know there are many third party program which supports to process
PDF files.But i want to get a free trial package before i decided to
purchase it.Thanks for any suggestions.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p4663182.html
Sent from the Users forum mailing list archive at Nabble.com.

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


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


Re: Generate PDF

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
I have also used flying saucer together with wicket: it was very easy to
produce nice looking PDFs using it.


On Mon, Dec 23, 2013 at 10:30 PM, Marios Skounakis <ms...@gmail.com> wrote:

> In case your requirements for pdf generation are not very complex, you
> could use FlyingSaucer (https://xhtmlrenderer.java.net/). It basically
> converts html to pdf. So you can create your output in html and then
> convert it to pdf using flying saucer.
>
>
> On Mon, Dec 23, 2013 at 10:45 PM, Niranjan Rao <nh...@gmail.com> wrote:
>
> > Do you want to use it in wicket application or java application? The link
> > is for csharp based tool and will not work in wicket application. But it
> > looks like they have java API also
> http://www.rasteredge.com/java-imaging/
> > .
> >
> > Personally we use apache pdf box. We don't create PDF, but we do analyze
> > PDF files using the API. Reasonably happy with PDF box.
> >
> >
> > On 12/22/2013 10:38 PM, Abigail wrote:
> >
> >> Hi there
> >> I am a beginner of PDF processing .And i am looking for a  PDF
> processing
> >> <http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/>
> >> program.I know there are many third party program which supports to
> >> process
> >> PDF files.But i want to get a free trial package before i decided to
> >> purchase it.Thanks for any suggestions.
> >>
> >>
> >>
> >> --
> >> View this message in context: http://apache-wicket.1842946.
> >> n4.nabble.com/Generate-PDF-tp3651354p4663182.html
> >> Sent from the Users forum mailing list archive at Nabble.com.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: Generate PDF

Posted by Marios Skounakis <ms...@gmail.com>.
In case your requirements for pdf generation are not very complex, you
could use FlyingSaucer (https://xhtmlrenderer.java.net/). It basically
converts html to pdf. So you can create your output in html and then
convert it to pdf using flying saucer.


On Mon, Dec 23, 2013 at 10:45 PM, Niranjan Rao <nh...@gmail.com> wrote:

> Do you want to use it in wicket application or java application? The link
> is for csharp based tool and will not work in wicket application. But it
> looks like they have java API also http://www.rasteredge.com/java-imaging/
> .
>
> Personally we use apache pdf box. We don't create PDF, but we do analyze
> PDF files using the API. Reasonably happy with PDF box.
>
>
> On 12/22/2013 10:38 PM, Abigail wrote:
>
>> Hi there
>> I am a beginner of PDF processing .And i am looking for a  PDF processing
>> <http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/>
>> program.I know there are many third party program which supports to
>> process
>> PDF files.But i want to get a free trial package before i decided to
>> purchase it.Thanks for any suggestions.
>>
>>
>>
>> --
>> View this message in context: http://apache-wicket.1842946.
>> n4.nabble.com/Generate-PDF-tp3651354p4663182.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Generate PDF

Posted by Niranjan Rao <nh...@gmail.com>.
Do you want to use it in wicket application or java application? The 
link is for csharp based tool and will not work in wicket application. 
But it looks like they have java API also 
http://www.rasteredge.com/java-imaging/.

Personally we use apache pdf box. We don't create PDF, but we do analyze 
PDF files using the API. Reasonably happy with PDF box.

On 12/22/2013 10:38 PM, Abigail wrote:
> Hi there
> I am a beginner of PDF processing .And i am looking for a  PDF processing
> <http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/>
> program.I know there are many third party program which supports to process
> PDF files.But i want to get a free trial package before i decided to
> purchase it.Thanks for any suggestions.
>
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p4663182.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


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


Re: Generate PDF

Posted by Abigail <ab...@yahoo.com>.
Hi there
I am a beginner of PDF processing .And i am looking for a  PDF processing
<http://www.rasteredge.com/how-to/csharp-imaging/pdf-processing/>  
program.I know there are many third party program which supports to process
PDF files.But i want to get a free trial package before i decided to
purchase it.Thanks for any suggestions.



--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p4663182.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Generate PDF

Posted by Martin Grigorov <mg...@apache.org>.
better check the documentation for <A> HTML element, specifically
'target' attribute

you don't need Wicket Link for this. You can do it with
WebMarkupContainer + AttributeModifier("href")
<a target="_blank" wicket:id="webMarkupContainer">

On Wed, Jul 13, 2011 at 5:11 PM, ramlael <gr...@gmail.com> wrote:
> I have requirement like, the 'pdf'/'html url' coming from web services,
> based on condition I need to display pdf/html in new window, if I use normal
> Link, not able to open the html in different window, if its ajax link I can
> add java script for opening in new window.
>
> Regards,
> Rambabu
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3665128.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Generate PDF

Posted by ramlael <gr...@gmail.com>.
I have requirement like, the 'pdf'/'html url' coming from web services, 
based on condition I need to display pdf/html in new window, if I use normal
Link, not able to open the html in different window, if its ajax link I can
add java script for opening in new window.

Regards,
Rambabu 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3665128.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Generate PDF

Posted by Martin Grigorov <mg...@apache.org>.
Why do you use Ajax for this ?

On Wed, Jul 13, 2011 at 4:38 PM, ramlael <gr...@gmail.com> wrote:
> Hi, its working fine with normal link, but not with ajax link, any idea about
> this problem?
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3665040.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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


Re: Generate PDF

Posted by ramlael <gr...@gmail.com>.
Hi, its working fine with normal link, but not with ajax link, any idea about
this problem?

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3665040.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: Generate PDF

Posted by Igor Vaynberg <ig...@gmail.com>.
put a target="export" attribute on the link tag.

-igor

On Thu, Jul 7, 2011 at 5:32 AM, ramlael <gr...@gmail.com> wrote:
> Hi Friends,
>
> I have requirement need to generate pdf with string data which is in byte
> stream and need to open in new window (pop up).  I have used below code ,
> but its displaying in same window, not in pop up.. please can you help me on
> this.
>
>  public void downloadPdf(RequestCycle requestCycle, final String
> eStatement, String filename) {
>
>        final WebResponse webResponse = (WebResponse)
> requestCycle.getResponse();
>        webResponse.setContentType("APPLICATION/PDF");
>        webResponse.setHeader("Content-Disposition", "inline; filename=\"" +
> filename + "\"");
>        requestCycle.setRequestTarget(new IRequestTarget() {
>
>            public void respond(RequestCycle requestCycle) {
>                try {
>
>                    OutputStream stream = webResponse.getOutputStream();
>                    OutputStreamWriter writer = new
> OutputStreamWriter(stream, "ISO-8859-1");
>                    writer.write(eStatement);
>                   writer.flush();
>                    writer.close();
>                } catch (IOException ex) {
>                    ex.printStackTrace();
>                }
>            }
>
>            public void detach(RequestCycle requestCycle) {
>            }
>
>        });
>    }
>
>
> Thanks in advance
> Rambabu
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Generate-PDF-tp3651354p3651354.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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