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

void PainterTest::testAppend (  )

Test if contents are appended correctly to pages with existing contents.

Definition at line 52 of file PainterTest.cpp.

References PoDoFo::PdfDocument::CreatePage(), PoDoFo::PdfPage::CreateStandardPageSize(), PoDoFo::ePdfPageSize_A4, PoDoFo::PdfPage::GetContents(), PoDoFo::PdfObject::GetStream(), PoDoFo::PdfStream::Set(), and PoDoFo::PdfPainter::SetPage().

{
    const char* pszExample1 = "BT (Hallo) Tj ET";
    const char* pszColor = " 1.000 1.000 1.000 rg\n";

    PdfMemDocument doc;
    PdfPage* pPage = doc.CreatePage( PdfPage::CreateStandardPageSize( ePdfPageSize_A4 ) );
    pPage->GetContents()->GetStream()->Set(pszExample1) ;
    
    this->CompareStreamContent(pPage->GetContents()->GetStream(), pszExample1);

    PdfPainter painter;
    painter.SetPage( pPage );
    painter.SetColor( 1.0, 1.0, 1.0 );
    painter.FinishPage();

    std::string newContent = pszExample1;
    newContent += pszColor;

    this->CompareStreamContent(pPage->GetContents()->GetStream(), newContent.c_str());
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index