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

void PoDoFo::PdfMemDocument::Load ( const char *  pBuffer,
long  lLen 
)

Load a PdfMemDocument from a buffer in memory

Parameters:
pBuffera memory area containing the PDF data
lLenlength of the buffer

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 193 of file PdfMemDocument.cpp.

References Clear(), PoDoFo::PdfDocument::GetObjects(), InitFromParser(), PoDoFo::PdfDocument::InitPagesTree(), m_pParser, and PoDoFo::PdfParser::ParseFile().

{
    this->Clear();

    // Call parse file instead of using the constructor
    // so that m_pParser is initialized for encrypted documents
    m_pParser = new PdfParser( PdfDocument::GetObjects() );
    m_pParser->ParseFile( pBuffer, lLen, true );
    InitFromParser( m_pParser );
    InitPagesTree();

    // Delete the temporary pdfparser object.
    // It is only set to m_pParser so that SetPassword can work
    delete m_pParser;
    m_pParser = NULL;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index