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

void PoDoFo::PdfPainter::SetPage ( PdfCanvas pPage ) [inherited]

Set the page on which the painter should draw. The painter will draw of course on the pages contents object.

Calls FinishPage() on the last page if it was not yet called.

Parameters:
pPagea PdfCanvas object (most likely a PdfPage or PdfXObject).
See also:
PdfPage
PdfXObject
FinishPage()
GetPage()

Definition at line 108 of file PdfPainter.cpp.

References PoDoFo::PdfStream::Append(), PoDoFo::PdfStream::BeginAppend(), PoDoFo::PdfStream::EndAppend(), PoDoFo::ePdfError_InvalidHandle, PoDoFo::PdfCanvas::GetContentsForAppending(), PoDoFo::PdfStream::GetLength(), PoDoFo::PdfObject::GetStream(), PoDoFo::PdfPainter::m_pCanvas, and PoDoFo::PdfPainter::m_pPage.

Referenced by PoDoFo::PdfTable::CheckForNewPage(), EncryptTest::CreatedEncrypedPdf(), and PainterTest::testAppend().

{
    // Ignore setting the same page twice
    if( m_pPage == pPage )
        return;

    if( m_pCanvas )
        m_pCanvas->EndAppend();

    m_pPage   = pPage;

    m_pCanvas = pPage ? pPage->GetContentsForAppending()->GetStream() : NULL;
    if ( m_pCanvas ) 
    {
        m_pCanvas->BeginAppend( false );
        if ( m_pCanvas->GetLength() ) 
        {    
            // there is already content here - so let's assume we are appending
            // as such, we MUST put in a "space" to separate whatever we do.
            m_pCanvas->Append( " " );
        }
    } 
    else 
    {
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
    }
}

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