本文整理汇总了C++中CPDF_Dictionary::GetArray方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Dictionary::GetArray方法的具体用法?C++ CPDF_Dictionary::GetArray怎么用?C++ CPDF_Dictionary::GetArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Dictionary
的用法示例。
在下文中一共展示了CPDF_Dictionary::GetArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: v_Load
FX_BOOL CPDF_CalRGB::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray)
{
CPDF_Dictionary* pDict = pArray->GetDict(1);
CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
int i;
for (i = 0; i < 3; i ++) {
m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
for (i = 0; i < 3; i ++) {
m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
pParam = pDict->GetArray(FX_BSTRC("Gamma"));
if (pParam) {
m_bGamma = TRUE;
for (i = 0; i < 3; i ++) {
m_Gamma[i] = pParam->GetNumber(i);
}
} else {
m_bGamma = FALSE;
}
pParam = pDict->GetArray(FX_BSTRC("Matrix"));
if (pParam) {
m_bMatrix = TRUE;
for (i = 0; i < 9; i ++) {
m_Matrix[i] = pParam->GetNumber(i);
}
} else {
m_bMatrix = FALSE;
}
return TRUE;
}
示例2: FPDFDOC_OCG_GetConfig
static CPDF_Dictionary* FPDFDOC_OCG_GetConfig(CPDF_Document *pDoc, const CPDF_Dictionary *pOCGDict, FX_BSTR bsState)
{
FXSYS_assert(pDoc && pOCGDict);
CPDF_Dictionary *pOCProperties = pDoc->GetRoot()->GetDict(FX_BSTRC("OCProperties"));
if (!pOCProperties) {
return NULL;
}
CPDF_Array *pOCGs = pOCProperties->GetArray(FX_BSTRC("OCGs"));
if (!pOCGs) {
return NULL;
}
if (FPDFDOC_OCG_FindGroup(pOCGs, pOCGDict) < 0) {
return NULL;
}
CPDF_Dictionary *pConfig = pOCProperties->GetDict(FX_BSTRC("D"));
CPDF_Array *pConfigs = pOCProperties->GetArray(FX_BSTRC("Configs"));
if (pConfigs) {
CPDF_Dictionary *pFind;
FX_INT32 iCount = pConfigs->GetCount();
for (FX_INT32 i = 0; i < iCount; i ++) {
pFind = pConfigs->GetDict(i);
if (!pFind) {
continue;
}
if (!FPDFDOC_OCG_HasIntent(pFind, FX_BSTRC("View"), FX_BSTRC("View"))) {
continue;
}
pConfig = pFind;
break;
}
}
return pConfig;
}
示例3: v_Init
FX_BOOL CPDF_ExpIntFunc::v_Init(CPDF_Object* pObj) {
CPDF_Dictionary* pDict = pObj->GetDict();
if (pDict == NULL) {
return FALSE;
}
CPDF_Array* pArray0 = pDict->GetArray(FX_BSTRC("C0"));
if (m_nOutputs == 0) {
m_nOutputs = 1;
if (pArray0) {
m_nOutputs = pArray0->GetCount();
}
}
CPDF_Array* pArray1 = pDict->GetArray(FX_BSTRC("C1"));
m_pBeginValues = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
m_pEndValues = FX_Alloc2D(FX_FLOAT, m_nOutputs, 2);
for (int i = 0; i < m_nOutputs; i++) {
m_pBeginValues[i] = pArray0 ? pArray0->GetFloat(i) : 0.0f;
m_pEndValues[i] = pArray1 ? pArray1->GetFloat(i) : 1.0f;
}
m_Exponent = pDict->GetFloat(FX_BSTRC("N"));
m_nOrigOutputs = m_nOutputs;
if (m_nOutputs && m_nInputs > INT_MAX / m_nOutputs) {
return FALSE;
}
m_nOutputs *= m_nInputs;
return TRUE;
}
示例4: LoadOCGStateFromConfig
FX_BOOL CPDF_OCContext::LoadOCGStateFromConfig(const CFX_ByteStringC& csConfig,
const CPDF_Dictionary* pOCGDict,
FX_BOOL& bValidConfig) const {
CPDF_Dictionary* pConfig =
FPDFDOC_OCG_GetConfig(m_pDocument, pOCGDict, csConfig);
if (!pConfig) {
return TRUE;
}
bValidConfig = TRUE;
FX_BOOL bState = pConfig->GetString(FX_BSTRC("BaseState"), FX_BSTRC("ON")) !=
FX_BSTRC("OFF");
CPDF_Array* pArray = pConfig->GetArray(FX_BSTRC("ON"));
if (pArray) {
if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
bState = TRUE;
}
}
pArray = pConfig->GetArray(FX_BSTRC("OFF"));
if (pArray) {
if (FPDFDOC_OCG_FindGroup(pArray, pOCGDict) >= 0) {
bState = FALSE;
}
}
pArray = pConfig->GetArray(FX_BSTRC("AS"));
if (pArray) {
CFX_ByteString csFind = csConfig + FX_BSTRC("State");
int32_t iCount = pArray->GetCount();
for (int32_t i = 0; i < iCount; i++) {
CPDF_Dictionary* pUsage = pArray->GetDict(i);
if (!pUsage) {
continue;
}
if (pUsage->GetString(FX_BSTRC("Event"), FX_BSTRC("View")) != csConfig) {
continue;
}
CPDF_Array* pOCGs = pUsage->GetArray(FX_BSTRC("OCGs"));
if (!pOCGs) {
continue;
}
if (FPDFDOC_OCG_FindGroup(pOCGs, pOCGDict) < 0) {
continue;
}
CPDF_Dictionary* pState = pUsage->GetDict(csConfig);
if (!pState) {
continue;
}
bState = pState->GetString(csFind) != FX_BSTRC("OFF");
}
}
return bState;
}
示例5: v_Init
FX_BOOL CPDF_StitchFunc::v_Init(CPDF_Object* pObj)
{
CPDF_Dictionary* pDict = pObj->GetDict();
if (pDict == NULL) {
return FALSE;
}
CPDF_Array* pArray = pDict->GetArray(FX_BSTRC("Functions"));
if (pArray == NULL) {
return FALSE;
}
m_nSubs = pArray->GetCount();
if (m_nSubs == 0) {
return FALSE;
}
m_pSubFunctions = FX_Alloc(CPDF_Function*, m_nSubs);
m_nOutputs = 0;
int i;
for (i = 0; i < m_nSubs; i ++) {
CPDF_Object* pSub = pArray->GetElementValue(i);
if (pSub == pObj) {
return FALSE;
}
m_pSubFunctions[i] = CPDF_Function::Load(pSub);
if (m_pSubFunctions[i] == NULL) {
return FALSE;
}
if (m_pSubFunctions[i]->CountOutputs() > m_nOutputs) {
m_nOutputs = m_pSubFunctions[i]->CountOutputs();
}
}
m_pBounds = FX_Alloc(FX_FLOAT, m_nSubs + 1);
m_pBounds[0] = m_pDomains[0];
pArray = pDict->GetArray(FX_BSTRC("Bounds"));
if (pArray == NULL) {
return FALSE;
}
for (i = 0; i < m_nSubs - 1; i ++) {
m_pBounds[i + 1] = pArray->GetFloat(i);
}
m_pBounds[m_nSubs] = m_pDomains[1];
m_pEncode = FX_Alloc(FX_FLOAT, m_nSubs * 2);
pArray = pDict->GetArray(FX_BSTRC("Encode"));
if (pArray == NULL) {
return FALSE;
}
for (i = 0; i < m_nSubs * 2; i ++) {
m_pEncode[i] = pArray->GetFloat(i);
}
return TRUE;
}
示例6: GetBorderDash
void CPDFSDK_Annot::GetBorderDash(CFX_IntArray& array) const
{
ASSERT(m_pAnnot != NULL);
ASSERT(m_pAnnot->m_pAnnotDict != NULL);
CPDF_Array* pDash = NULL;
CPDF_Array* pBorder = m_pAnnot->m_pAnnotDict->GetArray("Border");
if (pBorder)
{
pDash = pBorder->GetArray(3);
}
else
{
CPDF_Dictionary* pBSDict = m_pAnnot->m_pAnnotDict->GetDict("BS");
if (pBSDict)
{
pDash = pBSDict->GetArray("D");
}
}
if (pDash)
{
for (int i=0,sz=pDash->GetCount(); i<sz; i++)
{
array.Add(pDash->GetInteger(i));
}
}
}
示例7: ImportFromFDF
FX_BOOL CPDF_InterForm::ImportFromFDF(const CFDF_Document* pFDF,
FX_BOOL bNotify) {
if (pFDF == NULL) {
return FALSE;
}
CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF");
if (pMainDict == NULL) {
return FALSE;
}
CPDF_Array* pFields = pMainDict->GetArray("Fields");
if (pFields == NULL) {
return FALSE;
}
m_bsEncoding = pMainDict->GetString(FX_BSTRC("Encoding"));
if (bNotify && m_pFormNotify != NULL) {
int iRet = m_pFormNotify->BeforeFormImportData(this);
if (iRet < 0) {
return FALSE;
}
}
for (FX_DWORD i = 0; i < pFields->GetCount(); i++) {
CPDF_Dictionary* pField = pFields->GetDict(i);
if (pField == NULL) {
continue;
}
FDF_ImportField(pField, L"", bNotify);
}
if (bNotify && m_pFormNotify != NULL) {
m_pFormNotify->AfterFormImportData(this);
}
return TRUE;
}
示例8: ProcOpenAction
FX_BOOL CPDFSDK_Document::ProcOpenAction() {
if (!m_pDoc)
return FALSE;
CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
if (!pRoot)
return FALSE;
CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
if (!pOpenAction)
pOpenAction = pRoot->GetArray("OpenAction");
if (!pOpenAction)
return FALSE;
if (pOpenAction->IsArray())
return TRUE;
if (CPDF_Dictionary* pDict = pOpenAction->AsDictionary()) {
CPDF_Action action(pDict);
if (m_pEnv->GetActionHander())
m_pEnv->GetActionHander()->DoAction_DocOpen(action, this);
return TRUE;
}
return FALSE;
}
示例9: GetFieldsCount
FX_DWORD CPDF_ActionFields::GetFieldsCount() const {
if (!m_pAction) {
return 0;
}
CPDF_Dictionary* pDict = m_pAction->GetDict();
if (!pDict) {
return 0;
}
CFX_ByteString csType = pDict->GetString("S");
CPDF_Object* pFields = NULL;
if (csType == "Hide") {
pFields = pDict->GetElementValue("T");
} else {
pFields = pDict->GetArray("Fields");
}
if (!pFields)
return 0;
if (pFields->IsDictionary())
return 1;
if (pFields->IsString())
return 1;
if (CPDF_Array* pArray = pFields->AsArray())
return pArray->GetCount();
return 0;
}
示例10: GetField
CPDF_Object* CPDF_ActionFields::GetField(FX_DWORD iIndex) const {
if (!m_pAction) {
return NULL;
}
CPDF_Dictionary* pDict = m_pAction->GetDict();
if (!pDict) {
return NULL;
}
CFX_ByteString csType = pDict->GetString("S");
CPDF_Object* pFields = NULL;
if (csType == "Hide") {
pFields = pDict->GetElementValue("T");
} else {
pFields = pDict->GetArray("Fields");
}
if (!pFields) {
return NULL;
}
CPDF_Object* pFindObj = NULL;
if (pFields->IsDictionary() || pFields->IsString()) {
if (iIndex == 0)
pFindObj = pFields;
} else if (CPDF_Array* pArray = pFields->AsArray()) {
pFindObj = pArray->GetElementValue(iIndex);
}
return pFindObj;
}
示例11: if
std::vector<CPDF_Object*> CPDF_ActionFields::GetAllFields() const {
std::vector<CPDF_Object*> fields;
if (!m_pAction)
return fields;
CPDF_Dictionary* pDict = m_pAction->GetDict();
if (!pDict)
return fields;
CFX_ByteString csType = pDict->GetString("S");
CPDF_Object* pFields;
if (csType == "Hide")
pFields = pDict->GetElementValue("T");
else
pFields = pDict->GetArray("Fields");
if (!pFields)
return fields;
if (pFields->IsDictionary() || pFields->IsString()) {
fields.push_back(pFields);
} else if (CPDF_Array* pArray = pFields->AsArray()) {
FX_DWORD iCount = pArray->GetCount();
for (FX_DWORD i = 0; i < iCount; ++i) {
CPDF_Object* pObj = pArray->GetElementValue(i);
if (pObj) {
fields.push_back(pObj);
}
}
}
return fields;
}
示例12: ProcOpenAction
FX_BOOL CPDFSDK_Document::ProcOpenAction()
{
if(!m_pDoc)
return FALSE;
CPDF_Dictionary* pRoot = m_pDoc->GetRoot();
if (!pRoot)
return FALSE;
CPDF_Object* pOpenAction = pRoot->GetDict("OpenAction");
if(!pOpenAction)
pOpenAction = pRoot->GetArray("OpenAction");
if(!pOpenAction)
return FALSE;
if(pOpenAction->GetType()==PDFOBJ_ARRAY)
return TRUE;
if(pOpenAction->GetType()==PDFOBJ_DICTIONARY)
{
CPDF_Dictionary * pDict=(CPDF_Dictionary*)pOpenAction;
CPDF_Action action(pDict);
if(m_pEnv->GetActionHander())
m_pEnv->GetActionHander()->DoAction_DocOpen(action, this);
return TRUE;
}
return FALSE;
}
示例13: InsertNewPage
static int InsertNewPage(CPDF_Document* pDoc, int iPage, CPDF_Dictionary* pPageDict, CFX_DWordArray &pageList)
{
CPDF_Dictionary* pRoot = pDoc->GetRoot();
if (!pRoot) {
return -1;
}
CPDF_Dictionary* pPages = pRoot->GetDict(FX_BSTRC("Pages"));
if (!pPages) {
return -1;
}
int nPages = pDoc->GetPageCount();
if (iPage < 0 || iPage > nPages) {
return -1;
}
if (iPage == nPages) {
CPDF_Array* pPagesList = pPages->GetArray(FX_BSTRC("Kids"));
if (!pPagesList) {
pPagesList = FX_NEW CPDF_Array;
pPages->SetAt(FX_BSTRC("Kids"), pPagesList);
}
pPagesList->Add(pPageDict, pDoc);
pPages->SetAtInteger(FX_BSTRC("Count"), nPages + 1);
pPageDict->SetAtReference(FX_BSTRC("Parent"), pDoc, pPages->GetObjNum());
} else {
CFX_PtrArray stack;
stack.Add(pPages);
if (InsertDeletePDFPage(pDoc, pPages, iPage, pPageDict, TRUE, stack) < 0) {
return -1;
}
}
pageList.InsertAt(iPage, pPageDict->GetObjNum());
return iPage;
}
示例14: v_Load
FX_BOOL CPDF_CalGray::v_Load(CPDF_Document* pDoc, CPDF_Array* pArray) {
CPDF_Dictionary* pDict = pArray->GetDict(1);
CPDF_Array* pParam = pDict->GetArray(FX_BSTRC("WhitePoint"));
int i;
for (i = 0; i < 3; i++) {
m_WhitePoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
pParam = pDict->GetArray(FX_BSTRC("BlackPoint"));
for (i = 0; i < 3; i++) {
m_BlackPoint[i] = pParam ? pParam->GetNumber(i) : 0;
}
m_Gamma = pDict->GetNumber(FX_BSTRC("Gamma"));
if (m_Gamma == 0) {
m_Gamma = 1.0f;
}
return TRUE;
}
示例15:
DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) {
if (!linkAnnot)
return 0;
CPDF_Dictionary* pAnnotDict = (CPDF_Dictionary*)linkAnnot;
CPDF_Array* pArray = pAnnotDict->GetArray(FX_BSTRC("QuadPoints"));
if (!pArray)
return 0;
return pArray->GetCount() / 8;
}