File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes servlet not displaying all the pages in PDF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet not displaying all the pages in PDF" Watch "servlet not displaying all the pages in PDF" New topic

servlet not displaying all the pages in PDF

prav ba

Joined: Jun 17, 2007
Posts: 12
hi all,
have a very interesting problem. i have a servlet which is meant to download a PDF doco stored in an oracle database as a BLOB and display it in the users browser. The PDF is 900 pages long but in the browser it only displays 200 pages. Have tried it IE v 7 and FireFox v 3.6.8 what could be causing this ??

servlet code sniplet :

thanks in advance.
Paul Clapham

Joined: Oct 14, 2005
Posts: 18110

Have you confirmed that "cacheImpl.getPDF(ID)" actually returns the entire PDF document? 900 pages of PDF sounds like a lot of bytes to me, if I were writing the code I wouldn't load the entire document into memory. I would stream it from... wherever it's coming from... to the servlet's output stream. You may be running out of memory.
I agree. Here's the link:
subject: servlet not displaying all the pages in PDF
Similar Threads
renaming pdf file via servlet
ORA-01460: unimplemented or unreasonable conversion requested
streaming PDF document to the browser
reading BLOB type
storing BLOB type in oracle db