本文整理汇总了C++中CPDFDoc_Environment::GetSDKDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDFDoc_Environment::GetSDKDocument方法的具体用法?C++ CPDFDoc_Environment::GetSDKDocument怎么用?C++ CPDFDoc_Environment::GetSDKDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDFDoc_Environment
的用法示例。
在下文中一共展示了CPDFDoc_Environment::GetSDKDocument方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: activeDocs
FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
if (!vp.IsGetting())
return FALSE;
CJS_Context* pContext = (CJS_Context *)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument();
CJS_Array aDocs(pRuntime->GetIsolate());
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
{
CJS_Document* pJSDocument = NULL;
if (pDoc == pCurDoc)
{
JSFXObject pObj = JS_GetThisObj(*pRuntime);
if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"Document"))
pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
}
else
{
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime,L"Document"));
pJSDocument = (CJS_Document*)JS_GetPrivate(pRuntime->GetIsolate(),pObj);
ASSERT(pJSDocument != NULL);
}
aDocs.SetElement(0,CJS_Value(pRuntime->GetIsolate(),pJSDocument));
}
if (aDocs.GetLength() > 0)
vp << aDocs;
else
vp.SetNull();
return TRUE;
}
示例2: calculate
FX_BOOL app::calculate(IFXJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsSetting()) {
bool bVP;
vp >> bVP;
m_bCalculate = (FX_BOOL)bVP;
CJS_Context* pContext = (CJS_Context*)cc;
CPDFDoc_Environment* pApp = pContext->GetReaderApp();
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
CJS_Array aDocs(pRuntime->GetIsolate());
if (CPDFSDK_Document* pDoc = pApp->GetSDKDocument())
pDoc->GetInterForm()->EnableCalculate((FX_BOOL)m_bCalculate);
} else {
示例3:
DLLEXPORT void STDCALL
FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) {
if (!hHandle)
return;
CPDFDoc_Environment* pEnv = (CPDFDoc_Environment*)hHandle;
#ifdef PDF_ENABLE_XFA
CPDFXFA_App* pApp = CPDFXFA_App::GetInstance();
pApp->RemoveFormFillEnv(pEnv);
#else // PDF_ENABLE_XFA
if (CPDFSDK_Document* pSDKDoc = pEnv->GetSDKDocument()) {
pEnv->SetSDKDocument(NULL);
delete pSDKDoc;
}
#endif // PDF_ENABLE_XFA
delete pEnv;
}
示例4: 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
}