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


C++ CPDF_Dictionary类代码示例

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


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

示例1: SetBorderDash

void CPDFSDK_BAAnnot::SetBorderDash(const CFX_IntArray& array) {
  CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS");
  if (!pBSDict) {
    pBSDict = new CPDF_Dictionary;
    m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict);
  }

  CPDF_Array* pArray = new CPDF_Array;
  for (int i = 0, sz = array.GetSize(); i < sz; i++) {
    pArray->AddInteger(array[i]);
  }

  pBSDict->SetAt("D", pArray);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:14,代码来源:fsdk_baseannot.cpp

示例2: GetPageAttr

CPDF_Object* CPDF_Page::GetPageAttr(const CFX_ByteString& name) const {
  CPDF_Dictionary* pPageDict = m_pFormDict;
  std::set<CPDF_Dictionary*> visited;
  while (1) {
    visited.insert(pPageDict);
    if (CPDF_Object* pObj = pPageDict->GetDirectObjectFor(name))
      return pObj;

    pPageDict = pPageDict->GetDictFor("Parent");
    if (!pPageDict || pdfium::ContainsKey(visited, pPageDict))
      break;
  }
  return nullptr;
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:14,代码来源:cpdf_page.cpp

示例3: FPDFPage_SetCropBox

DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bottom, float right, float top)
{
	if(!page)
		return;

	CPDF_Page* pPage = (CPDF_Page*)page;
	CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
	CPDF_Array* pCropBoxArray = new CPDF_Array;
	pCropBoxArray->Add(new CPDF_Number(left));
	pCropBoxArray->Add(new CPDF_Number(bottom));
	pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(right)));
	pCropBoxArray->Add(new CPDF_Number(FX_FLOAT(top)));
	pPageDict->SetAt("CropBox", pCropBoxArray);
}
开发者ID:MI-4i,项目名称:platform_external_pdfium,代码行数:14,代码来源:fpdf_transformpage.cpp

示例4: RemoveInterFormFont

void RemoveInterFormFont(CPDF_Dictionary* pFormDict, CFX_ByteString csNameTag) {
  if (!pFormDict || csNameTag.IsEmpty()) {
    return;
  }
  CPDF_Dictionary* pDR = pFormDict->GetDictBy("DR");
  if (!pDR) {
    return;
  }
  CPDF_Dictionary* pFonts = pDR->GetDictBy("Font");
  if (!pFonts) {
    return;
  }
  pFonts->RemoveAt(csNameTag);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:14,代码来源:doc_utils.cpp

示例5: GetRoot

int CPDF_Document::_GetPageCount() const {
    CPDF_Dictionary* pRoot = GetRoot();
    if (!pRoot) {
        return 0;
    }
    CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
    if (!pPages) {
        return 0;
    }
    if (!pPages->KeyExist("Kids")) {
        return 1;
    }
    return _CountPages(pPages, 0);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:14,代码来源:fpdf_parser_document.cpp

示例6: FPDFDOC_OCG_GetUsageTypeString

FX_BOOL CPDF_OCContext::LoadOCGState(const CPDF_Dictionary *pOCGDict) const
{
    if (!FPDFDOC_OCG_HasIntent(pOCGDict, FX_BSTRC("View"), FX_BSTRC("View"))) {
        return TRUE;
    }
    CFX_ByteString csState = FPDFDOC_OCG_GetUsageTypeString(m_eUsageType);
    CPDF_Dictionary *pUsage = pOCGDict->GetDict(FX_BSTRC("Usage"));
    if (pUsage) {
        CPDF_Dictionary *pState = pUsage->GetDict(csState);
        if (pState) {
            CFX_ByteString csFind = csState + FX_BSTRC("State");
            if (pState->KeyExist(csFind)) {
                return pState->GetString(csFind) != FX_BSTRC("OFF");
            }
        }
        if (csState != FX_BSTRC("View")) {
            pState = pUsage->GetDict(FX_BSTRC("View"));
            if (pState && pState->KeyExist(FX_BSTRC("ViewState"))) {
                return pState->GetString(FX_BSTRC("ViewState")) != FX_BSTRC("OFF");
            }
        }
    }
    FX_BOOL bDefValid = FALSE;
    return LoadOCGStateFromConfig(csState, pOCGDict, bDefValid);
}
开发者ID:151706061,项目名称:PDFium,代码行数:25,代码来源:doc_ocg.cpp

示例7: DisplayPass

void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage,
                                 CFX_RenderDevice* pDevice,
                                 CPDF_RenderContext* pContext,
                                 FX_BOOL bPrinting,
                                 CFX_Matrix* pMatrix,
                                 FX_BOOL bWidgetPass,
                                 CPDF_RenderOptions* pOptions,
                                 FX_RECT* clip_rect) {
  for (const auto& pAnnot : m_AnnotList) {
    bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET;
    if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget))
      continue;

    uint32_t annot_flags = pAnnot->GetFlags();
    if (annot_flags & ANNOTFLAG_HIDDEN)
      continue;

    if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0)
      continue;

    if (!bPrinting && (annot_flags & ANNOTFLAG_NOVIEW))
      continue;

    if (pOptions) {
      CPDF_OCContext* pOCContext = pOptions->m_pOCContext;
      CPDF_Dictionary* pAnnotDict = pAnnot->GetAnnotDict();
      if (pOCContext && pAnnotDict &&
          !pOCContext->CheckOCGVisible(pAnnotDict->GetDictBy("OC"))) {
        continue;
      }
    }
    CFX_FloatRect annot_rect_f = pAnnot->GetRect();
    CFX_Matrix matrix = *pMatrix;
    if (clip_rect) {
      annot_rect_f.Transform(&matrix);
      FX_RECT annot_rect = annot_rect_f.GetOuterRect();
      annot_rect.Intersect(*clip_rect);
      if (annot_rect.IsEmpty()) {
        continue;
      }
    }
    if (pContext) {
      pAnnot->DrawInContext(pPage, pContext, &matrix, CPDF_Annot::Normal);
    } else if (!pAnnot->DrawAppearance(pPage, pDevice, &matrix,
                                       CPDF_Annot::Normal, pOptions)) {
      pAnnot->DrawBorder(pDevice, &matrix, pOptions);
    }
  }
}
开发者ID:gradescope,项目名称:pdfium,代码行数:49,代码来源:cpdf_annotlist.cpp

示例8: 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_Alloc2D(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;
}
开发者ID:was4444,项目名称:pdfium,代码行数:49,代码来源:fpdf_page_func.cpp

示例9: CPDF_Pattern

CPDF_TilingPattern::CPDF_TilingPattern(CPDF_Document* pDoc, CPDF_Object* pPatternObj, const CFX_AffineMatrix* parentMatrix) :
    CPDF_Pattern(parentMatrix)
{
    m_PatternType = PATTERN_TILING;
    m_pPatternObj = pPatternObj;
    m_pDocument = pDoc;
    CPDF_Dictionary* pDict = m_pPatternObj->GetDict();
    ASSERT(pDict != NULL);
    m_Pattern2Form = pDict->GetMatrix(FX_BSTRC("Matrix"));
    m_bColored = pDict->GetInteger(FX_BSTRC("PaintType")) == 1;
    if (parentMatrix) {
        m_Pattern2Form.Concat(*parentMatrix);
    }
    m_pForm = NULL;
}
开发者ID:151706061,项目名称:PDFium,代码行数:15,代码来源:fpdf_page_pattern.cpp

示例10: FPDF_CountNamedDests

DLLEXPORT FPDF_DWORD STDCALL FPDF_CountNamedDests(FPDF_DOCUMENT document)
{
    if (!document) return 0;
    CPDF_Document* pDoc = (CPDF_Document*)document;

    CPDF_Dictionary* pRoot = pDoc->GetRoot();
    if (!pRoot) return 0;

    CPDF_NameTree nameTree(pDoc, FX_BSTRC("Dests"));
    int count = nameTree.GetCount();
    CPDF_Dictionary* pDest = pRoot->GetDict(FX_BSTRC("Dests"));
    if (pDest)
        count += pDest->GetCount();
    return count;
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:15,代码来源:fpdfview.cpp

示例11: GetMaxLen

int CPDF_FormField::GetMaxLen() const {
  if (CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "MaxLen"))
    return pObj->GetInteger();

  for (int i = 0; i < m_ControlList.GetSize(); i++) {
    CPDF_FormControl* pControl = m_ControlList.GetAt(i);
    if (!pControl)
      continue;

    CPDF_Dictionary* pWidgetDict = pControl->m_pWidgetDict;
    if (pWidgetDict->KeyExist("MaxLen"))
      return pWidgetDict->GetIntegerBy("MaxLen");
  }
  return 0;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:15,代码来源:doc_formfield.cpp

示例12: GetPagesDict

void CPDF_Document::DeletePage(int iPage) {
  CPDF_Dictionary* pPages = GetPagesDict();
  if (!pPages)
    return;

  int nPages = pPages->GetIntegerFor("Count");
  if (iPage < 0 || iPage >= nPages)
    return;

  std::set<CPDF_Dictionary*> stack = {pPages};
  if (InsertDeletePDFPage(this, pPages, iPage, nullptr, FALSE, &stack) < 0)
    return;

  m_PageList.RemoveAt(iPage);
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:15,代码来源:cpdf_document.cpp

示例13: FixPageFields

void CPDF_InterForm::FixPageFields(const CPDF_Page* pPage) {
  CPDF_Dictionary* pPageDict = pPage->m_pFormDict;
  if (!pPageDict)
    return;

  CPDF_Array* pAnnots = pPageDict->GetArrayFor("Annots");
  if (!pAnnots)
    return;

  for (size_t i = 0; i < pAnnots->GetCount(); i++) {
    CPDF_Dictionary* pAnnot = pAnnots->GetDictAt(i);
    if (pAnnot && pAnnot->GetStringFor("Subtype") == "Widget")
      LoadField(pAnnot, 0);
  }
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:15,代码来源:cpdf_interform.cpp

示例14: ASSERT

void CPDF_Document::CreateNewDoc()
{
    ASSERT(m_pRootDict == NULL && m_pInfoDict == NULL);
    m_pRootDict = FX_NEW CPDF_Dictionary;
    m_pRootDict->SetAtName("Type", "Catalog");
    int objnum = AddIndirectObject(m_pRootDict);
    CPDF_Dictionary* pPages = FX_NEW CPDF_Dictionary;
    pPages->SetAtName("Type", "Pages");
    pPages->SetAtNumber("Count", 0);
    pPages->SetAt("Kids", FX_NEW CPDF_Array);
    objnum = AddIndirectObject(pPages);
    m_pRootDict->SetAtReference("Pages", this, objnum);
    m_pInfoDict = FX_NEW CPDF_Dictionary;
    AddIndirectObject(m_pInfoDict);
}
开发者ID:ouyang789987,项目名称:PDFium.js,代码行数:15,代码来源:fpdf_edit_doc.cpp

示例15: GetURI

CFX_ByteString CPDF_Action::GetURI(CPDF_Document* pDoc) const {
  CFX_ByteString csURI;
  if (!m_pDict)
    return csURI;
  if (m_pDict->GetStringFor("S") != "URI")
    return csURI;

  csURI = m_pDict->GetStringFor("URI");
  CPDF_Dictionary* pRoot = pDoc->GetRoot();
  CPDF_Dictionary* pURI = pRoot->GetDictFor("URI");
  if (pURI) {
    if (csURI.Find(":", 0) < 1)
      csURI = pURI->GetStringFor("Base") + csURI;
  }
  return csURI;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:16,代码来源:cpdf_action.cpp


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