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

bool PoDoFo::PdfPage::SetPageHeight ( int  newHeight )

Set the current page height in PDF Units

Returns:
true if successfull, false otherwise

Definition at line 446 of file PdfPage.cpp.

References PoDoFo::PdfVariant::GetArray(), GetInheritedKeyFromObject(), PoDoFo::PdfElement::GetObject(), and PoDoFo::PdfVariant::IsArray().

{
    PdfObject*   pObj;
        
    // Take advantage of inherited values - walking up the tree if necessary
    pObj = const_cast<PdfObject*>(GetInheritedKeyFromObject( "MediaBox", this->GetObject() ));
    
    // assign the value of the box from the array
    if ( pObj && pObj->IsArray() )
    {
        pObj->GetArray()[3].SetNumber(newHeight);

        PdfObject*   pObjCropBox;

        // Take advantage of inherited values - walking up the tree if necessary
        pObjCropBox = const_cast<PdfObject*>(GetInheritedKeyFromObject( "CropBox", this->GetObject() ));

        if ( pObjCropBox && pObjCropBox->IsArray() )
        {
            pObjCropBox->GetArray()[3].SetNumber(newHeight);
            return true;
        }else
        {
            return false;
        }
    }else
    {
        return false;
    }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index