本文整理汇总了C++中CPDFXFA_Document::GetPDFDoc方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFXFA_Document::GetPDFDoc方法的具体用法?C++ CPDFXFA_Document::GetPDFDoc怎么用?C++ CPDFXFA_Document::GetPDFDoc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFXFA_Document
的用法示例。
在下文中一共展示了CPDFXFA_Document::GetPDFDoc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viewRef
DLLEXPORT FPDF_TEXTPAGE STDCALL FPDFText_LoadPage(FPDF_PAGE page) {
CPDF_Page* pPDFPage = CPDFPageFromFPDFPage(page);
if (!pPDFPage)
return nullptr;
#ifdef PDF_ENABLE_XFA
CPDFXFA_Page* pPage = (CPDFXFA_Page*)page;
CPDFXFA_Document* pDoc = pPage->GetDocument();
CPDF_ViewerPreferences viewRef(pDoc->GetPDFDoc());
#else // PDF_ENABLE_XFA
CPDF_ViewerPreferences viewRef(pPDFPage->m_pDocument);
#endif // PDF_ENABLE_XFA
CPDF_TextPage* textpage = new CPDF_TextPage(
pPDFPage, viewRef.IsDirectionR2L() ? FPDFText_Direction::Right
: FPDFText_Direction::Left);
textpage->ParseTextPage();
return textpage;
}
示例2: 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
}