Пример #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);
}
Пример #2
0
CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Annot* pPDFAnnot) {
  CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
  ASSERT(pEnv);
  CPDFSDK_AnnotHandlerMgr* pAnnotHandler = pEnv->GetAnnotHandlerMgr();
  CPDFSDK_Annot* pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this);
  if (!pSDKAnnot)
    return nullptr;

  m_fxAnnotArray.push_back(pSDKAnnot);
  pAnnotHandler->Annot_OnCreate(pSDKAnnot);
  return pSDKAnnot;
}