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

void PoDoFo::PdfPainter::DrawXObject ( double  dX,
double  dY,
PdfXObject pObject,
double  dScaleX = 1.0,
double  dScaleY = 1.0 
) [inherited]

Draw an XObject on the current page. For PdfImage use DrawImage.

Parameters:
dXthe x coordinate (bottom left position of the XObject)
dYthe y coordinate (bottom position of the XObject)
pObjectan PdfXObject
dScaleXoption scaling factor in x direction
dScaleYoption scaling factor in y direction
See also:
DrawImage

Definition at line 935 of file PdfPainter.cpp.

References PoDoFo::PdfPainter::AddToPageResources(), PoDoFo::PdfStream::Append(), PoDoFo::ePdfError_InvalidHandle, PoDoFo::PdfXObject::GetIdentifier(), PoDoFo::PdfName::GetName(), PoDoFo::PdfXObject::GetObjectReference(), PoDoFo::PdfPainter::m_oss, PoDoFo::PdfPainter::m_pCanvas, PODOFO_RAISE_ERROR, and PODOFO_RAISE_LOGIC_IF.

Referenced by PoDoFo::PdfPainter::DrawImage(), and DrawXObjectMM().

{
    PODOFO_RAISE_LOGIC_IF( !m_pCanvas, "Call SetPage() first before doing drawing operations." );

    if( !pObject )
    {
        PODOFO_RAISE_ERROR( ePdfError_InvalidHandle );
    }

    // use OriginalReference() as the XObject might have been written to disk
    // already and is not in memory anymore in this case.
    this->AddToPageResources( pObject->GetIdentifier(), pObject->GetObjectReference(), "XObject" );

      std::streamsize oldPrecision = m_oss.precision(clPainterHighPrecision);
    m_oss.str("");
    m_oss << "q" << std::endl
          << dScaleX << " 0 0 "
          << dScaleY << " "
          << dX << " " 
          << dY << " cm" << std::endl
          << "/" << pObject->GetIdentifier().GetName() << " Do" << std::endl << "Q" << std::endl;
      m_oss.precision(oldPrecision);
    
    m_pCanvas->Append( m_oss.str() );
}

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