Opened 14 years ago

Closed 14 years ago

#18 closed enhancement (fixed)

Plug-in API should support delayed loading of requested file pages only

Reported by: hn_netlabs_trac@… Owned by: Eugene Romanenko
Priority: major Milestone:
Component: Lucide Core Version: 1.0 Beta 1
Keywords: Cc:


First of all my congratulations to the very good idea of a generic document viewer. It looks really promising. For developers the plugin API needs to be documented but I guess this is planned already.

I just had a quick look at the plugin sources of the PDF reader because it takes quite long to open a PDF file with many pages.

The Plug-in API seems to support only loading a file as a whole with all pages. This might not be possible for large documents (e.g. big multipage images or complex PDFs) due to system memory constraints. Also it forces the user to wait unecessarily long time and finally the user might not even want to have a look at all pages of the document.

As a workaround plugins could defer loading pages to view during rendering but this is obviously not intended as there is no way to report read errors.

I'd suggest to either enhance the loadFile function or introduce some kind of page switching function with a return code that allows plugins to load a document page on demand. This might be also helpful for supporting document streaming from an URL if this is planned sometime. If memory gets low, the plugin could drop pages from memory if not needed to reduce memory footprint.


Change History (4)

comment:1 Changed 14 years ago by anonymous

Milestone: Beta 1

Removed milestone beta 1, this should just be taken for the preparation of a new milestone.

comment:2 Changed 14 years ago by Eugene Romanenko

I just had a quick look at the plugin sources of the PDF reader because it takes quite long to open a PDF file with many pages.

It's long only for first pdf open, while engine scans all system fonts and creates fontconfig files. After first time pdfs opens fast and independent from number of pages. If your files always opens long - try delete \PSFONTS\fonts.cache-1, \PSFONTS\PFM\fonts.cache-1, %HOME%\fonts.conf and %HOME%\fonts.cache-1. Lucide will recreate these files on next pdf opening.

comment:3 Changed 14 years ago by anonymous

It helped. After deleting the cache files the PDFs are now opened much faster.

What do you think about the delayed page loading? Is it supported somehow already officially?

Not sure if you are aware of the Generalised Bitmap Module lib (gbm.dll). It supports multipage images as well (e.g. TIF). If I find some time I'll try to write a Lucide plugin as an adapter to it and so many bitmap formats would be supported.

My question about delayed loading is related to this. Bitmaps might be quite big and if the user has for instance large multipage images, completely loading them might stress a less good equipped machine soon or even cause out-of-memory issues.

Is there already some documentation of the plugin API available?

BTW, if for a file format multiple plugins are available, which one is used?

comment:4 Changed 14 years ago by hn_netlabs_trac@…

Resolution: fixed
Status: newclosed

As this report is not very specific, I'll close it.

I found out how delayed loading can be implemented in my GBM plugin.

The missing error reporting capabilities during rendering a document page are not yet resolved. I'll open a new ticket just for this.

Note: See TracTickets for help on using tickets.