本文整理汇总了C++中CPDFSDK_Document::GetPageView方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFSDK_Document::GetPageView方法的具体用法?C++ CPDFSDK_Document::GetPageView怎么用?C++ CPDFSDK_Document::GetPageView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFSDK_Document
的用法示例。
在下文中一共展示了CPDFSDK_Document::GetPageView方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: SetFocusForAnnot
void CFFL_FormFiller::SetFocusForAnnot(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
UnderlyingPageType* pPage = pWidget->GetUnderlyingPage();
CPDFSDK_Document* pDoc = m_pApp->GetSDKDocument();
CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage, true);
if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE))
pWnd->SetFocus();
m_bValid = TRUE;
FX_RECT rcRect = GetViewBBox(pPageView, pAnnot);
InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom);
}
示例3:
DLLEXPORT FPDF_BOOL STDCALL FORM_OnChar(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int nChar, int modifier)
{
if (!hHandle || !page)
return FALSE;
CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
if(!pFXDoc)
return FALSE;
CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
if(!pPageView)
return FALSE;
return pPageView->OnChar(nChar, modifier);
}
示例4: pt
DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y)
{
if (!hHandle || !page)
return FALSE;
CPDFSDK_Document* pFXDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc();
if(!pFXDoc)
return FALSE;
CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDF_Page*)page);
if(!pPageView)
return FALSE;
// double page_x = 0;
// double page_y = 0;
// pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y);
CPDF_Point pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
return pPageView->OnLButtonDown(pt, modifier);
}
示例5: UnderlyingFromFPDFPage
DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page,
FPDF_FORMHANDLE hHandle) {
if (!hHandle)
return;
CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetSDKDocument();
if (!pSDKDoc)
return;
UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
if (!pPage)
return;
CPDFSDK_PageView* pPageView = pSDKDoc->GetPageView(pPage, FALSE);
if (pPageView) {
pPageView->SetValid(FALSE);
// RemovePageView() takes care of the delete for us.
pSDKDoc->RemovePageView(pPage);
}
}
示例6: GetCurPageView
CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() {
CPDF_Page* pPage = m_pAnnot->GetPDFPage();
CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
return pSDKDoc ? pSDKDoc->GetPageView(pPage) : nullptr;
}
示例7: GetCurPageView
CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView(bool renew) {
UnderlyingPageType* pPage = m_pAnnot->GetUnderlyingPage();
CPDFSDK_Document* pSDKDoc = m_pApp->GetSDKDocument();
return pSDKDoc ? pSDKDoc->GetPageView(pPage, renew) : nullptr;
}
示例8: clip
DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle,
FPDF_BITMAP bitmap,
FPDF_PAGE page,
int start_x,
int start_y,
int size_x,
int size_y,
int rotate,
int flags) {
if (!hHandle)
return;
UnderlyingPageType* pPage = UnderlyingFromFPDFPage(page);
if (!pPage)
return;
#ifndef PDF_ENABLE_XFA
CPDF_RenderOptions options;
if (flags & FPDF_LCD_TEXT)
options.m_Flags |= RENDER_CLEARTYPE;
else
options.m_Flags &= ~RENDER_CLEARTYPE;
// Grayscale output
if (flags & FPDF_GRAYSCALE) {
options.m_ColorMode = RENDER_COLOR_GRAY;
options.m_ForeColor = 0;
options.m_BackColor = 0xffffff;
}
options.m_AddFlags = flags >> 8;
options.m_pOCContext = new CPDF_OCContext(pPage->m_pDocument);
#else // PDF_ENABLE_XFA
CPDFXFA_Document* pDocument = pPage->GetDocument();
if (!pDocument)
return;
CPDF_Document* pPDFDoc = pDocument->GetPDFDoc();
if (!pPDFDoc)
return;
CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
CPDFSDK_Document* pFXDoc = pEnv->GetSDKDocument();
if (!pFXDoc)
return;
#endif // PDF_ENABLE_XFA
CFX_Matrix matrix;
pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate);
FX_RECT clip(start_x, start_y, start_x + size_x, start_y + size_y);
#ifdef _SKIA_SUPPORT_
std::unique_ptr<CFX_SkiaDevice> pDevice(new CFX_SkiaDevice);
#else
std::unique_ptr<CFX_FxgeDevice> pDevice(new CFX_FxgeDevice);
#endif
pDevice->Attach((CFX_DIBitmap*)bitmap);
pDevice->SaveState();
pDevice->SetClip_Rect(clip);
#ifndef PDF_ENABLE_XFA
if (CPDFSDK_PageView* pPageView = FormHandleToPageView(hHandle, pPage))
pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options);
#else // PDF_ENABLE_XFA
CPDF_RenderOptions options;
if (flags & FPDF_LCD_TEXT)
options.m_Flags |= RENDER_CLEARTYPE;
else
options.m_Flags &= ~RENDER_CLEARTYPE;
// Grayscale output
if (flags & FPDF_GRAYSCALE) {
options.m_ColorMode = RENDER_COLOR_GRAY;
options.m_ForeColor = 0;
options.m_BackColor = 0xffffff;
}
options.m_AddFlags = flags >> 8;
options.m_pOCContext = new CPDF_OCContext(pPDFDoc);
if (CPDFSDK_PageView* pPageView = pFXDoc->GetPageView(pPage))
pPageView->PageView_OnDraw(pDevice.get(), &matrix, &options, clip);
#endif // PDF_ENABLE_XFA
pDevice->RestoreState();
delete options.m_pOCContext;
#ifdef PDF_ENABLE_XFA
options.m_pOCContext = NULL;
#endif // PDF_ENABLE_XFA
}
示例9: LeftBottom
TEST_F(FSDKBaseFormEmbeddertest, CBA_AnnotIterator) {
EXPECT_TRUE(OpenDocument("annotiter.pdf"));
EXPECT_TRUE(LoadPage(0));
EXPECT_TRUE(LoadPage(1));
EXPECT_TRUE(LoadPage(2));
CPDF_Rect LeftBottom(200, 200, 220, 220);
CPDF_Rect RightBottom(400, 201, 420, 221);
CPDF_Rect LeftTop(201, 400, 221, 420);
CPDF_Rect RightTop(401, 401, 421, 421);
CPDFSDK_Document* pSDKDoc =
CPDFSDK_Document::FromFPDFFormHandle(form_handle());
{
// Page 0 specifies "row order".
CBA_AnnotIterator iter(pSDKDoc->GetPageView(0), "Widget", "");
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftTop);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
EXPECT_EQ(iter.GetFirstAnnot(), pAnnot);
pAnnot = iter.GetLastAnnot();
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightBottom);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftTop);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetPrevAnnot(pAnnot);
EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
}
{
// Page 1 specifies "column order"
CBA_AnnotIterator iter(pSDKDoc->GetPageView(1), "Widget", "");
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftTop);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
EXPECT_EQ(iter.GetFirstAnnot(), pAnnot);
pAnnot = iter.GetLastAnnot();
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftTop);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightBottom);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetPrevAnnot(pAnnot);
EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
}
{
// Page 2 specifies "struct order"
CBA_AnnotIterator iter(pSDKDoc->GetPageView(2), "Widget", "");
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftTop);
pAnnot = iter.GetNextAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
EXPECT_EQ(iter.GetFirstAnnot(), pAnnot);
pAnnot = iter.GetLastAnnot();
CheckRect(pAnnot->GetRect(), RightBottom);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftTop);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetPrevAnnot(pAnnot);
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetPrevAnnot(pAnnot);
EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
}
}