FreeMED.Djvu

Wrapper class to handle Djvu documents.

Summary
Wrapper class to handle Djvu documents.
Number of pages in the current Djvu document.
Get page image
Get textual content of a page thumbnail.
Get list of chunks contained in the parent DjVu file.
Convert DjVu document to a PDF document.

Functions

Djvu

function Djvu ($filename)

Parameters

$filenameFilename of source DjVu file.

NumberOfPages

function NumberOfPages ( )

Returns

Number of pages in the current Djvu document.

GetPage

function GetPage ($page,  
$contents =  false,
$force_ps =  false,
$force_rotation =  true)

Get page image

Parameters

$pagePage number to return
$contents(optional) Boolean, return the contents instead of the filename.  Defaults to false.
$force_ps(optional) Boolean, force no JPEG conversion.  Defaults to false.
$force_rotate(optional) Boolean, force 90 degree rotation

Returns

Either JPEG image of file in string or name of temporary file.

GetPageThumbnail

function GetPageThumbnail ($page,  
$size = 300)

Get textual content of a page thumbnail.

Parameters

$pagePage number
$size(optional) Maximum dimension of thumbnail.  Defaults to 300 (px).

Returns

String containing JPEG thumbnail of specified page.

StoredChunks

function StoredChunks ( )

Get list of chunks contained in the parent DjVu file.

Returns

Array of chunk names.

ToPDF

function ToPDF ($to_file =  false)

Convert DjVu document to a PDF document.

Parameters

$to_file(optional) Boolean, for the function to dump contents to a file, then return the file name.  If false, returns a string containing the PDF file data.  Defaults to false.

Returns

PDF file data or file name, depending on parameters

function Djvu ($filename)
function NumberOfPages ( )
Number of pages in the current Djvu document.
function GetPage ($page,  
$contents =  false,
$force_ps =  false,
$force_rotation =  true)
Get page image
function GetPageThumbnail ($page,  
$size = 300)
Get textual content of a page thumbnail.
function StoredChunks ( )
Get list of chunks contained in the parent DjVu file.
function ToPDF ($to_file =  false)
Convert DjVu document to a PDF document.