Laura, Yes, you can. As I understand it you are displaying a single PDF page in a JScrollPane but you want to display the entire PDF, so that the pages can be scrolled through, like in most PDF viewers. However, the problem is that rendering all of the images is either too slow, or uses too much memory. Also rendering each image on-the-fly is also too slow for smooth scrolling.
It’s important to understand that any rendering of any kind of file, PDF included, is always to an image. The screen can only display images - everything on your computer screen right now is an image. So any talk of rendering PDF without using images does not make sense - perhaps there was some misunderstanding? Anyway, what you want to do is to render only the pages which will be displayed on the screen (e.g. often only 3 pages) and to then render the subsequent pages as they are needed *before* the user scrolls to them, i.e. when displaying page n you want to render page n+1. But you need to do the rendering in a background thread, so that your UI thread has smooth scrolling. At a bare minimum, you’re going to need: - Image cache - Background thread rendering - Custom JPane with “virtual” scrollbar over entire document length Thanks -- John > On 14 Nov 2014, at 17:24, Laura DE STAERKE <[email protected]> wrote: > > Good morning, Good afternoon, Good evening and Good night, > > First of all, I would like to apologize in advance if what I write is not > very clear for you, English is not my native language but I'll do my best > :-) . > > I have done some researches on the web these last days to understand if > PDFBox can be used or not to render PDF. > > I currently use it to display my PDF into a JScrollPane in converting the > page I want to display into an image. I have added as well a toolbar to > enable the user to interact on the PDF (zoom, go to the next page, > rotation, print etc...) > > I would like to be able to display the pdf without having to create some > images. When I look at the PDFBox features described on the PDFBox website, > PDF rendering is not one of them. > > However in digging a bit into the web I have found some people that say > that they success in displaying PDF with PDFBox without creating images, > others, found in the forums, say that it doesn't work well so they gave up > and do that by creating images now (like* I *currently* do)*. > > The reasons I want to stop displaying the PDF with images are that I have > notice that the performance are not very good when the document is complex > and I would like to be able to display a continuous view of the document > that would enable teh user to go over all the document with the mouse wheel. > > I thank you a lot for your time and thank you in advance for your help. > > Have a good weekend > > Regards

