本文整理汇总了C++中CPDFSDK_PageView::DeleteAnnot方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFSDK_PageView::DeleteAnnot方法的具体用法?C++ CPDFSDK_PageView::DeleteAnnot怎么用?C++ CPDFSDK_PageView::DeleteAnnot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFSDK_PageView
的用法示例。
在下文中一共展示了CPDFSDK_PageView::DeleteAnnot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeField
FX_BOOL Document::removeField(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
if (!(m_pDocument->GetPermissions(FPDFPERM_MODIFY) ||
m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM))) return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
if (params.size() != 1) {
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
return FALSE;
}
CFX_WideString sFieldName = params[0].ToCFXWideString();
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
ASSERT(pInterForm != NULL);
CFX_PtrArray widgets;
pInterForm->GetWidgets(sFieldName, widgets);
int nSize = widgets.GetSize();
if (nSize > 0)
{
for (int i=0; i<nSize; i++)
{
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets[i];
ASSERT(pWidget != NULL);
CPDF_Rect rcAnnot = pWidget->GetRect();
rcAnnot.left -= 1;
rcAnnot.bottom -= 1;
rcAnnot.right += 1;
rcAnnot.top += 1;
CFX_RectArray aRefresh;
aRefresh.Add(rcAnnot);
CPDF_Page* pPage = pWidget->GetPDFPage();
ASSERT(pPage != NULL);
CPDFSDK_PageView* pPageView = m_pDocument->GetPageView(pPage);
pPageView->DeleteAnnot(pWidget);
pPageView->UpdateRects(aRefresh);
}
m_pDocument->SetChangeMark();
}
return TRUE;
}
示例2: WidgetPreRemove
void CPDFXFA_DocEnvironment::WidgetPreRemove(CXFA_FFWidget* hWidget,
CXFA_WidgetAcc* pWidgetData) {
if (m_pContext->GetDocType() != DOCTYPE_DYNAMIC_XFA || !hWidget)
return;
CXFA_FFPageView* pPageView = hWidget->GetPageView();
if (!pPageView)
return;
CPDFXFA_Page* pXFAPage = m_pContext->GetXFAPage(pPageView);
if (!pXFAPage)
return;
CPDFSDK_PageView* pSdkPageView =
m_pContext->GetFormFillEnv()->GetPageView(pXFAPage, true);
if (CPDFSDK_Annot* pAnnot = pSdkPageView->GetAnnotByXFAWidget(hWidget))
pSdkPageView->DeleteAnnot(pAnnot);
}