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

void PagesTreeTest::CreateTestTreePoDoFo ( PoDoFo::PdfMemDocument rDoc ) [private]

Create a pages tree with 100 pages, where every page object has an additional key PoDoFoTestPageNumber with the original page number of the page.

This method uses PoDoFo's build in PdfPagesTree which creates a flat tree.

You can check the page number ussing IsPageNumber()

See also:
IsPageNumber

Definition at line 314 of file PagesTreeTest.cpp.

References PoDoFo::PdfDictionary::AddKey(), PoDoFo::PdfDocument::CreatePage(), PoDoFo::PdfPage::CreateStandardPageSize(), PoDoFo::ePdfPageSize_A4, PoDoFo::PdfVariant::GetDictionary(), PoDoFo::PdfElement::GetObject(), and PoDoFo::PdfDocument::GetPageCount().

{
    for(int i=0; i<PODOFO_TEST_NUM_PAGES; i++) 
    {
        PdfPage* pPage = rDoc.CreatePage( PdfPage::CreateStandardPageSize( ePdfPageSize_A4 ) );
        pPage->GetObject()->GetDictionary().AddKey( PODOFO_TEST_PAGE_KEY, static_cast<pdf_int64>(i) );

        CPPUNIT_ASSERT_EQUAL( rDoc.GetPageCount(), i + 1 );
    }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index