当前位置: 首页>>代码示例>>C++>>正文


C++ CPDF_Dictionary::GetElementValue方法代码示例

本文整理汇总了C++中CPDF_Dictionary::GetElementValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Dictionary::GetElementValue方法的具体用法?C++ CPDF_Dictionary::GetElementValue怎么用?C++ CPDF_Dictionary::GetElementValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPDF_Dictionary的用法示例。


在下文中一共展示了CPDF_Dictionary::GetElementValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: FindResourceObj

CPDF_Object* CPDF_StreamContentParser::FindResourceObj(
    const CFX_ByteStringC& type,
    const CFX_ByteString& name) {
  if (!m_pResources) {
    return NULL;
  }
  if (m_pResources == m_pPageResources) {
    CPDF_Dictionary* pList = m_pResources->GetDict(type);
    if (!pList) {
      return NULL;
    }
    CPDF_Object* pRes = pList->GetElementValue(name);
    return pRes;
  }
  CPDF_Dictionary* pList = m_pResources->GetDict(type);
  if (!pList) {
    if (!m_pPageResources) {
      return NULL;
    }
    CPDF_Dictionary* pList = m_pPageResources->GetDict(type);
    if (!pList) {
      return NULL;
    }
    CPDF_Object* pRes = pList->GetElementValue(name);
    return pRes;
  }
  CPDF_Object* pRes = pList->GetElementValue(name);
  return pRes;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:29,代码来源:fpdf_page_parser.cpp

示例2: GetAttr

CPDF_Object* CPDF_StructElementImpl::GetAttr(FX_BSTR owner, FX_BSTR name, FX_BOOL bInheritable, FX_FLOAT fLevel)
{
    if (fLevel > nMaxRecursion) {
        return NULL;
    }
    if (bInheritable) {
        CPDF_Object* pAttr = GetAttr(owner, name, FALSE);
        if (pAttr) {
            return pAttr;
        }
        if (m_pParent == NULL) {
            return NULL;
        }
        return m_pParent->GetAttr(owner, name, TRUE, fLevel + 1);
    }
    CPDF_Object* pA = m_pDict->GetElementValue(FX_BSTRC("A"));
    if (pA) {
        CPDF_Dictionary* pAttrDict = FindAttrDict(pA, owner);
        if (pAttrDict) {
            CPDF_Object* pAttr = pAttrDict->GetElementValue(name);
            if (pAttr) {
                return pAttr;
            }
        }
    }
    CPDF_Object* pC = m_pDict->GetElementValue(FX_BSTRC("C"));
    if (pC == NULL) {
        return NULL;
    }
    CPDF_Dictionary* pClassMap = m_pTree->m_pTreeRoot->GetDict(FX_BSTRC("ClassMap"));
    if (pClassMap == NULL) {
        return NULL;
    }
    if (pC->GetType() == PDFOBJ_ARRAY) {
        CPDF_Array* pArray = (CPDF_Array*)pC;
        for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) {
            CFX_ByteString class_name = pArray->GetString(i);
            CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
            if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
                return pClassDict->GetElementValue(name);
            }
        }
        return NULL;
    }
    CFX_ByteString class_name = pC->GetString();
    CPDF_Dictionary* pClassDict = pClassMap->GetDict(class_name);
    if (pClassDict && pClassDict->GetString(FX_BSTRC("O")) == owner) {
        return pClassDict->GetElementValue(name);
    }
    return NULL;
}
开发者ID:151706061,项目名称:PDFium,代码行数:51,代码来源:doc_tagged.cpp

示例3: 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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:25,代码来源:doc_action.cpp

示例4: 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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:27,代码来源:doc_action.cpp

示例5: 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;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:31,代码来源:doc_action.cpp

示例6: ASSERT

CPDF_ShadingPattern::CPDF_ShadingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* parentMatrix) : CPDF_Pattern(parentMatrix)
{
    m_PatternType = PATTERN_SHADING;
    m_pPatternObj = bShading ? NULL : pPatternObj;
    m_pDocument = pDoc;
    m_bShadingObj = bShading;
    if (!bShading) {
        CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
        ASSERT(pDict != NULL);
        m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
        m_pShadingObj = pDict->GetElementValue(FX_BSTRC("Shading"));
        if (parentMatrix) {
            m_Pattern2Form.Concat(*parentMatrix);
        }
    } else {
        m_pShadingObj = pPatternObj;
    }
    m_ShadingType = 0;
    m_pCS = NULL;
    m_nFuncs = 0;
    for (int i = 0; i < 4; i ++) {
        m_pFunctions[i] = NULL;
    }
    m_pCountedCS = NULL;
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:25,代码来源:fpdf_page_pattern.cpp

示例7: Load

FX_BOOL CPDF_ShadingPattern::Load()
{
    if (m_ShadingType != 0) {
        return TRUE;
    }
    CPDF_Dictionary* pShadingDict = m_pShadingObj ? m_pShadingObj->GetDict() : NULL;
    if (pShadingDict == NULL) {
        return FALSE;
    }
    if (m_nFuncs) {
        for (int i = 0; i < m_nFuncs; i ++)
            if (m_pFunctions[i]) {
                delete m_pFunctions[i];
            }
        m_nFuncs = 0;
    }
    CPDF_Object* pFunc = pShadingDict->GetElementValue(FX_BSTRC("Function"));
    if (pFunc) {
        if (pFunc->GetType() == PDFOBJ_ARRAY) {
            m_nFuncs = ((CPDF_Array*)pFunc)->GetCount();
            if (m_nFuncs > 4) {
                m_nFuncs = 4;
            }
            for (int i = 0; i < m_nFuncs; i ++) {
                m_pFunctions[i] = CPDF_Function::Load(((CPDF_Array*)pFunc)->GetElementValue(i));
            }
        } else {
            m_pFunctions[0] = CPDF_Function::Load(pFunc);
            m_nFuncs = 1;
        }
    }
    CPDF_Object* pCSObj = pShadingDict->GetElementValue(FX_BSTRC("ColorSpace"));
    if (pCSObj == NULL) {
        return FALSE;
    }
    CPDF_DocPageData* pDocPageData = m_pDocument->GetPageData();
    m_pCS = pDocPageData->GetColorSpace(pCSObj, NULL);
    if (m_pCS) {
        m_pCountedCS = pDocPageData->FindColorSpacePtr(m_pCS->GetArray());
    }
    m_ShadingType = pShadingDict->GetInteger(FX_BSTRC("ShadingType"));
    return TRUE;
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:43,代码来源:fpdf_page_pattern.cpp

示例8: CFX_WideString

CFX_WideString CFDF_Document::GetWin32Path() const
{
    CPDF_Dictionary* pDict = m_pRootDict ? m_pRootDict->GetDict(FX_BSTRC("FDF")) : NULL;
    CPDF_Object* pFileSpec = pDict ? pDict->GetElementValue(FX_BSTRC("F")) : NULL;
    if (pFileSpec == NULL) {
        return CFX_WideString();
    }
    if (pFileSpec->GetType() == PDFOBJ_STRING) {
        return FPDF_FileSpec_GetWin32Path(m_pRootDict->GetDict(FX_BSTRC("FDF")));
    }
    return FPDF_FileSpec_GetWin32Path(pFileSpec);
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:12,代码来源:fpdf_parser_fdf.cpp

示例9: LookupNamedDest

CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc,
                                           const CFX_ByteStringC& sName) {
  CPDF_Object* pValue = LookupValue(sName);
  if (!pValue) {
    CPDF_Dictionary* pDests = pDoc->GetRoot()->GetDictBy("Dests");
    if (!pDests)
      return nullptr;
    pValue = pDests->GetElementValue(sName);
  }
  if (!pValue)
    return nullptr;
  if (CPDF_Array* pArray = pValue->AsArray())
    return pArray;
  if (CPDF_Dictionary* pDict = pValue->AsDictionary())
    return pDict->GetArrayBy("D");
  return nullptr;
}
开发者ID:andoma,项目名称:pdfium,代码行数:17,代码来源:doc_basic.cpp

示例10: IsAppearanceValid

FX_BOOL CPDFSDK_BAAnnot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode) {
  CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
  if (!pAP)
    return FALSE;

  // Choose the right sub-ap
  const FX_CHAR* ap_entry = "N";
  if (mode == CPDF_Annot::Down)
    ap_entry = "D";
  else if (mode == CPDF_Annot::Rollover)
    ap_entry = "R";
  if (!pAP->KeyExist(ap_entry))
    ap_entry = "N";

  // Get the AP stream or subdirectory
  CPDF_Object* psub = pAP->GetElementValue(ap_entry);
  return !!psub;
}
开发者ID:andoma,项目名称:pdfium,代码行数:18,代码来源:fsdk_baseannot.cpp

示例11: GenerateContent

void CPDF_PageContentGenerate::GenerateContent() {
    CFX_ByteTextBuf buf;
    CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
    for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
        CPDF_PageObject* pPageObj = (CPDF_PageObject*)m_pageObjects[i];
        if (!pPageObj || pPageObj->m_Type != PDFPAGE_IMAGE) {
            continue;
        }
        ProcessImage(buf, (CPDF_ImageObject*)pPageObj);
    }
    CPDF_Object* pContent =
        pPageDict ? pPageDict->GetElementValue("Contents") : NULL;
    if (pContent != NULL) {
        pPageDict->RemoveAt("Contents");
    }
    CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
    pStream->SetData(buf.GetBuffer(), buf.GetLength(), FALSE, FALSE);
    m_pDocument->AddIndirectObject(pStream);
    pPageDict->SetAtReference("Contents", m_pDocument, pStream->GetObjNum());
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例12:

CPDF_Image::~CPDF_Image()
{
    if (m_bInline) {
        if (m_pStream) {
#ifndef FOXIT_CHROME_BUILD
            CPDF_Dictionary* pDict = m_pStream->GetDict();
            if (pDict) {
                CPDF_Object* pCSObj = pDict->GetElementValue(FX_BSTRC("ColorSpace"));
                if (pCSObj && m_pDocument) {
                    m_pDocument->RemoveColorSpaceFromPageData(pCSObj);
                }
            }
#endif
            m_pStream->Release();
        }
        if (m_pInlineDict) {
            m_pInlineDict->Release();
        }
    }
}
开发者ID:151706061,项目名称:PDFium,代码行数:20,代码来源:fpdf_page_image.cpp

示例13: LookupValue

CPDF_Array*	CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc, FX_BSTR sName)
{
    CPDF_Object* pValue = LookupValue(sName);
    if (pValue == NULL) {
        CPDF_Dictionary* pDests = pDoc->GetRoot()->GetDict(FX_BSTRC("Dests"));
        if (pDests == NULL) {
            return NULL;
        }
        pValue = pDests->GetElementValue(sName);
    }
    if (pValue == NULL) {
        return NULL;
    }
    if (pValue->GetType() == PDFOBJ_ARRAY) {
        return (CPDF_Array*)pValue;
    }
    if (pValue->GetType() == PDFOBJ_DICTIONARY) {
        return ((CPDF_Dictionary*)pValue)->GetArray(FX_BSTRC("D"));
    }
    return NULL;
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:21,代码来源:doc_basic.cpp

示例14: FPDFDOC_GetAnnotAP

CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, CPDF_Annot::AppearanceMode mode)
{
    CPDF_Dictionary* pAP = pAnnotDict->GetDict("AP");
    if (pAP == NULL) {
        return NULL;
    }
    const FX_CHAR* ap_entry = "N";
    if (mode == CPDF_Annot::Down) {
        ap_entry = "D";
    } else if (mode == CPDF_Annot::Rollover) {
        ap_entry = "R";
    }
    if (!pAP->KeyExist(ap_entry)) {
        ap_entry = "N";
    }
    CPDF_Object* psub = pAP->GetElementValue(ap_entry);
    if (psub == NULL) {
        return NULL;
    }
    CPDF_Stream* pStream = NULL;
    if (psub->GetType() == PDFOBJ_STREAM) {
        pStream = (CPDF_Stream*)psub;
    } else if (psub->GetType() == PDFOBJ_DICTIONARY) {
        CFX_ByteString as = pAnnotDict->GetString("AS");
        if (as.IsEmpty()) {
            CFX_ByteString value = pAnnotDict->GetString(FX_BSTRC("V"));
            if (value.IsEmpty()) {
                CPDF_Dictionary* pDict = pAnnotDict->GetDict(FX_BSTRC("Parent"));
                value = pDict ? pDict->GetString(FX_BSTRC("V")) : CFX_ByteString();
            }
            if (value.IsEmpty() || !((CPDF_Dictionary*)psub)->KeyExist(value)) {
                as = FX_BSTRC("Off");
            } else {
                as = value;
            }
        }
        pStream = ((CPDF_Dictionary*)psub)->GetStream(as);
    }
    return pStream;
}
开发者ID:Gardenya,项目名称:pdfium,代码行数:40,代码来源:doc_annot.cpp

示例15: if

FX_BOOL	CPDFSDK_Annot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode)
{
	ASSERT(m_pAnnot != NULL);
	ASSERT(m_pAnnot->m_pAnnotDict != NULL);
	
	CPDF_Dictionary* pAP = m_pAnnot->m_pAnnotDict->GetDict("AP");
	if (pAP == NULL) return FALSE;
	
	// Choose the right sub-ap
	const FX_CHAR* ap_entry = "N";
	if (mode == CPDF_Annot::Down)
		ap_entry = "D";
	else if (mode == CPDF_Annot::Rollover)
		ap_entry = "R";
	if (!pAP->KeyExist(ap_entry))
		ap_entry = "N";
	
	// Get the AP stream or subdirectory
	CPDF_Object* psub = pAP->GetElementValue(ap_entry);
	if (psub == NULL) return FALSE;
	
	return TRUE;
}
开发者ID:witwall,项目名称:pdfium,代码行数:23,代码来源:fsdk_baseannot.cpp


注:本文中的CPDF_Dictionary::GetElementValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。