本文整理汇总了C++中CPDFDoc_Environment::GetActionHander方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFDoc_Environment::GetActionHander方法的具体用法?C++ CPDFDoc_Environment::GetActionHander怎么用?C++ CPDFDoc_Environment::GetActionHander使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFDoc_Environment
的用法示例。
在下文中一共展示了CPDFDoc_Environment::GetActionHander方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: aa
DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page,
FPDF_FORMHANDLE hHandle,
int aaType) {
if (!hHandle)
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return;
if (pSDKDoc->GetPageView(pPage, FALSE)) {
CPDFDoc_Environment* pEnv = pSDKDoc->GetEnv();
CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();
CPDF_Dictionary* pPageDict = pPDFPage->m_pFormDict;
CPDF_AAction aa(pPageDict->GetDictBy("AA"));
if (FPDFPAGE_AACTION_OPEN == aaType) {
if (aa.ActionExist(CPDF_AAction::OpenPage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
}
} else {
if (aa.ActionExist(CPDF_AAction::ClosePage)) {
CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
}
}
}
}
示例2:
DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandle, int aaType)
{
if(!hHandle || !page)
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
CPDF_Page* pPage = (CPDF_Page*)page;
CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
if(pPageView)
{
CPDFDoc_Environment *pEnv = pSDKDoc->GetEnv();
ASSERT(pEnv != NULL);
CPDFSDK_ActionHandler *pActionHandler = pEnv->GetActionHander();
ASSERT(pActionHandler != NULL);
CPDF_Dictionary *pPageDict = pPage->m_pFormDict;
ASSERT(pPageDict != NULL);
CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA"));
FX_BOOL bExistOAAction = FALSE;
FX_BOOL bExistCAAction = FALSE;
if (FPDFPAGE_AACTION_OPEN == aaType)
{
bExistOAAction = aa.ActionExist(CPDF_AAction::OpenPage);
if (bExistOAAction)
{
CPDF_Action action = aa.GetAction(CPDF_AAction::OpenPage);
pActionHandler->DoAction_Page(action, CPDF_AAction::OpenPage, pSDKDoc);
}
}
else
{
bExistCAAction = aa.ActionExist(CPDF_AAction::ClosePage);
if (bExistCAAction)
{
CPDF_Action action = aa.GetAction(CPDF_AAction::ClosePage);
pActionHandler->DoAction_Page(action, CPDF_AAction::ClosePage, pSDKDoc);
}
}
}
}