No one logged in. Log in

MegaZine3 - tips, tricks and hints

Information, Ideas, News, Stories around MegaZine3

B005 Optimization of big SWF books

Hans J Nücke - Thursday, February 04, 2010
Big books with lots of text will be very slow with the default settings and need some tuning.
A big city's phone book easily has 1000 pages. With millons of words.

First steps: reduce the qualiy of the embedded JPGS and the setting of the qualitycontrol parameter. This is explained  in another blog: see PDF Conversion Optimization

To reduce the amount of RAM (memory, cache) consumed by MegaZine3 and with that decrease loading times is to set the paramter maxloaded to lower values. The default is 22 pages, which will load that amount of pages into the cache.
Even if this is performed in the background, once the actual page is presented, this consumes computer power and memory. With the result of slow page flips and risk of a browser crash.

So try settings with lower values like:

<book pageheight="960" pagewidth"640" ...  maxloaded="6" plugins="console, print, ... ..." ... ...>

The size of the book-pages also has some influence, so try to reduce pageheight an pagewidth.
This can improve the speed of page flips at lower resolutions.

We also are working on additional features to speed up this kind of books like automatic selection of JPG or SWF.
Stay tuned ...


B004 PDF Conversion optimization

Hans J Nücke - Wednesday, February 03, 2010
Here 2 points that might help to improve the performance of bigger books with lot of text, created out of PDF files using pdf2megazine:

  1. Set qualitycontrol="false"
    For big books with a lot of text on every page the default settings of book@qualitycontrol (i.e. the parameter "qualtiycontrol" that optionally can be added to the <book> element) might not improve performance but even slow down the speed of page flips.

    Reason:The calculation of thelower resolution takes so much time that the benefit, i.e. gaining speed when rendering during the page flip, does not pay back.
    Suggestion: set value to false like 
    <book plugins="batchpages, console, print, ... whatever plugins" qualitycontrol="false" further parameters>

  2. Reduce JPG Quality
    If the PDF pages not only contain text but also jpg images, there is a way to reduce the size of the pages.The pdf2megazine.bat script makes use of the converter pdf2swf. And there are other optional switches that can be used when calling pdf2swf.
    The one of interest here is the "-J" switch, which controls the quality of the JPG images.
    To use the "J" switch, open pdf2megazine.bat with a text editor such as Notepad++.

    At line 64 you will find:
    "%PDF2SWF%" 20 -q -t -T 9 -G -p %%i -f "%from%" "%to%%%i.swf"

    add -j 20 after "%PDF2SWF%" so that line 64 now looks like this:
    "%PDF2SWF%" -j 20 -q -t -T 9 -G -p %%i -f "%from%" "%to%%%i.swf"

    ... save and close your file. After running a new conversion, you will see that all pages are now smaller in size

    "-J 0" for lowest quality (very ppor!)
    "-J 100" for highest quality (the default!)

    To find the best compromise between performance and quality, you might have to do the "try and error" approach, since the setting depends on your images and your personal likings