Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

void PoDoFo::PdfParser::ParseFile ( const char *  pszFilename,
bool  bLoadOnDemand = true 
)

Open a PDF file and parse it.

Parameters:
pszFilenamefilename of the file which is going to be parsed
bLoadOnDemandIf true all objects will be read from the file at the time they are accesed first. If false all objects will be read immediately. This is faster if you do not need the complete PDF file in memory.

This might throw a PdfError( ePdfError_InvalidPassword ) exception if a password is required to read this PDF. Call SetPassword with the correct password in this case.

See also:
SetPassword

Definition at line 126 of file PdfParser.cpp.

References PoDoFo::PdfRefCountedInputDevice::Device(), PoDoFo::ePdfError_FileNotFound, PoDoFo::ePdfError_InvalidHandle, PODOFO_RAISE_ERROR, and PODOFO_RAISE_ERROR_INFO.

Referenced by HasLinearizationDict(), PoDoFo::PdfMemDocument::Load(), ParseFile(), PdfParser(), and ReadTrailer().

{
    if( !pszFilename || !pszFilename[0] )
    {
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
    }

    PdfRefCountedInputDevice device( pszFilename, "rb" );
    if( !device.Device() )
    {
        PODOFO_RAISE_ERROR_INFO( ePdfError_FileNotFound, pszFilename );
    }

    this->ParseFile( device, bLoadOnDemand );
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index