pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sipin Verma <sipinverm...@gmail.com>
Subject Re: How to use pdfviewer in liferay portlet to see a pdf
Date Thu, 13 Sep 2012 12:32:49 GMT
I have created a <a> link in my jsp and have called the
<portlet:actionURL/> .
*<a href="<portlet:actionURL/>" > show pdf</a>*

In my processAction() I have kept below code:
*URL url = new URL("http://samplepdf.com/sample.pdf");
PDDocument.load(url);*

It's not showing anything to me after the jsp page is loaded. My doubt is
that after loading the document, how is it shown in jsp? Do we have to use
some tag to show the pdf?

Can you add the missing part in my code or give me a working sample of code
that loads a pdf document and shows in jsp.

Thanks




On Thu, Sep 13, 2012 at 4:48 PM, <jlonc@gi-bon.sk> wrote:

> you have several options:
> a) download that file (you can use HttpURLConnection or something else),
> store it locally and use PDDocument.load(file)
> b) open inputstream from that remote server and use
> PDDocument.load(inputstream)
> c) use PDDocument.load(url)
>
> actualy this is not matter of pdfbox.
>
>
>
> Best regards
> Juraj Lonc
>
>
>
>
> From:   Sipin Verma <sipinverma16@gmail.com>
> To:     users@pdfbox.apache.org,
> Date:   13. 09. 2012 13:09
> Subject:        Re: How to use pdfviewer in liferay portlet to see a pdf
>
>
>
> ok. Thanks for your reply.
> I have 2 options to read pdf files.
> 1) from document library
> 2) from some other server
>
> Suppose I have the pdf download link then how can I feed this link to pdf
> box so that it opens it in my portlet page.
>
>
>
> On Thu, Sep 13, 2012 at 4:32 PM, <jlonc@gi-bon.sk> wrote:
>
> > Hi Sipin,
> >
> > portlet is not able to open file from your local machine.
> > portlet has access to server files only.
> >
> > so you have to make portlet where user can upload some pdf file, then
> > portlet can process that file (and then use pdfbox)
> >
> >
> > Best regards
> > Juraj Lonc
> >
> >
> >
> >
> >
> > From:   Sipin Verma <sipinverma16@gmail.com>
> > To:     users@pdfbox.apache.org,
> > Date:   13. 09. 2012 12:56
> > Subject:        How to use pdfviewer in liferay portlet to see a pdf
> >
> >
> >
> > Hi ,
> >
> > My requirement is to open a pdf document from my local machine hard disk
> > or
> > from a online available pdf link in my liferay portlet.
> > I am looking into PDFBox but I am not able to understand how to start.
> > What
> > APIs I should use to open a pdf document in my portlet.
> >
> > Can anyone help me with some sample code or directions to use pdfviewer
> > for
> > opening a pdf in browser.
> >
> > *Sipin Verma*
> >
> >
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message