Logo Search packages:      
Sourcecode: djvulibre version File versions

GP< DjVuImage > DjVuDocument::get_page ( const GUTF8String id,
bool  sync = true,
DjVuPort port = 0 
)

Returns {GP} pointer to {DjVuImage} corresponding to the specified ID. This function behaves exactly as the get_page()# function above. The only thing worth mentioning here is how the ID# parameter is treated.

First of all the function checks, if the ID contains a number. If so, it just calls the get_page()# function above. If ID is ZERO# or just empty, page number #-1# is assumed. Otherwise the ID is translated to the URL using {id_to_url}().

Definition at line 1049 of file DjVuDocument.cpp.

References DjVuPortcaster::add_route(), DjVuImage::create(), get_djvu_file(), and DjVuPort::get_portcaster().

{
   check();
   DEBUG_MSG("DjVuDocument::get_page(): ID='" << id << "'\n");
   DEBUG_MAKE_INDENT(3);

   GP<DjVuImage> dimg;
   const GP<DjVuFile> file(get_djvu_file(id));
   if(file)
   {
     dimg=DjVuImage::create(file);
     if (port)
       DjVuPort::get_portcaster()->add_route(dimg, port);
   
     file->resume_decode();
     if (dimg && sync)
       dimg->wait_for_complete_decode();
   }
   return dimg;
}


Generated by  Doxygen 1.6.0   Back to index