示例#1
0
void CPDFSDK_PageView::LoadFXAnnots()
{
    CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();

    FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
    //Disable the default AP construction.
    CPDF_InterForm::EnableUpdateAP(FALSE);
    m_pAnnotList = new CPDF_AnnotList(m_page);
    CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
    int nCount = m_pAnnotList->Count();
        SetLock(TRUE);
    for(int i=0; i<nCount; i++)
    {
        CPDF_Annot* pPDFAnnot = m_pAnnotList->GetAt(i);
        CPDF_Document * pDoc = GetPDFDocument();

        CheckUnSupportAnnot(pDoc, pPDFAnnot);

        CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
        ASSERT(pAnnotHandlerMgr != NULL);

        if(pAnnotHandlerMgr)
        {
            CPDFSDK_Annot* pAnnot = pAnnotHandlerMgr->NewAnnot(pPDFAnnot, this);
            if(!pAnnot)
                continue;
            m_fxAnnotArray.Add(pAnnot);

            pAnnotHandlerMgr->Annot_OnLoad(pAnnot);
        }

    }
        SetLock(FALSE);
}