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


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

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


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

示例1: GetFontFileStreamAcc

CPDF_StreamAcc* CPDF_DocPageData::GetFontFileStreamAcc(CPDF_Stream* pFontStream)
{
    if (!pFontStream) {
        return NULL;
    }
    CPDF_CountedObject<CPDF_StreamAcc*>* ftData;
    if (m_FontFileMap.Lookup(pFontStream, ftData)) {
        ftData->m_nCount ++;
        return ftData->m_Obj;
    }
    ftData = FX_NEW CPDF_CountedObject<CPDF_StreamAcc*>;
    if (!ftData) {
        return NULL;
    }
    CPDF_StreamAcc* pFontFile = FX_NEW CPDF_StreamAcc;
    if (!pFontFile) {
        delete ftData;
        return NULL;
    }
    CPDF_Dictionary* pFontDict = pFontStream->GetDict();
    FX_INT32 org_size = pFontDict->GetInteger(FX_BSTRC("Length1")) + pFontDict->GetInteger(FX_BSTRC("Length2")) + pFontDict->GetInteger(FX_BSTRC("Length3"));
    if (org_size < 0) {
        org_size = 0;
    }
    pFontFile->LoadAllData(pFontStream, FALSE, org_size);
    ftData->m_nCount = 2;
    ftData->m_Obj = pFontFile;
    m_FontFileMap.SetAt(pFontStream, ftData);
    return pFontFile;
}
开发者ID:Gottox,项目名称:pdfium,代码行数:30,代码来源:fpdf_page_doc.cpp

示例2: v_Init

FX_BOOL CPDF_SampledFunc::v_Init(CPDF_Object* pObj) {
  if (pObj->GetType() != PDFOBJ_STREAM) {
    return FALSE;
  }
  CPDF_Stream* pStream = (CPDF_Stream*)pObj;
  CPDF_Dictionary* pDict = pStream->GetDict();
  CPDF_Array* pSize = pDict->GetArray(FX_BSTRC("Size"));
  CPDF_Array* pEncode = pDict->GetArray(FX_BSTRC("Encode"));
  CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
  m_nBitsPerSample = pDict->GetInteger(FX_BSTRC("BitsPerSample"));
  if (m_nBitsPerSample > 32) {
    return FALSE;
  }
  m_SampleMax = 0xffffffff >> (32 - m_nBitsPerSample);
  m_pSampleStream = new CPDF_StreamAcc;
  m_pSampleStream->LoadAllData(pStream, FALSE);
  m_pEncodeInfo = FX_Alloc(SampleEncodeInfo, m_nInputs);
  FX_SAFE_DWORD nTotalSampleBits = 1;
  for (int i = 0; i < m_nInputs; i++) {
    m_pEncodeInfo[i].sizes = pSize ? pSize->GetInteger(i) : 0;
    if (!pSize && i == 0) {
      m_pEncodeInfo[i].sizes = pDict->GetInteger(FX_BSTRC("Size"));
    }
    nTotalSampleBits *= m_pEncodeInfo[i].sizes;
    if (pEncode) {
      m_pEncodeInfo[i].encode_min = pEncode->GetFloat(i * 2);
      m_pEncodeInfo[i].encode_max = pEncode->GetFloat(i * 2 + 1);
    } else {
      m_pEncodeInfo[i].encode_min = 0;
      if (m_pEncodeInfo[i].sizes == 1) {
        m_pEncodeInfo[i].encode_max = 1;
      } else {
        m_pEncodeInfo[i].encode_max = (FX_FLOAT)m_pEncodeInfo[i].sizes - 1;
      }
    }
  }
  nTotalSampleBits *= m_nBitsPerSample;
  nTotalSampleBits *= m_nOutputs;
  FX_SAFE_DWORD nTotalSampleBytes = nTotalSampleBits;
  nTotalSampleBytes += 7;
  nTotalSampleBytes /= 8;
  if (!nTotalSampleBytes.IsValid() || nTotalSampleBytes.ValueOrDie() == 0 ||
      nTotalSampleBytes.ValueOrDie() > m_pSampleStream->GetSize()) {
    return FALSE;
  }
  m_pDecodeInfo = FX_Alloc(SampleDecodeInfo, m_nOutputs);
  for (int i = 0; i < m_nOutputs; i++) {
    if (pDecode) {
      m_pDecodeInfo[i].decode_min = pDecode->GetFloat(2 * i);
      m_pDecodeInfo[i].decode_max = pDecode->GetFloat(2 * i + 1);
    } else {
      m_pDecodeInfo[i].decode_min = m_pRanges[i * 2];
      m_pDecodeInfo[i].decode_max = m_pRanges[i * 2 + 1];
    }
  }
  return TRUE;
}
开发者ID:was4444,项目名称:pdfium,代码行数:57,代码来源:fpdf_page_func.cpp

示例3: LoadKid

void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum, CPDF_Object* pKidObj, CPDF_StructKid* pKid)
{
    pKid->m_Type = CPDF_StructKid::Invalid;
    if (pKidObj == NULL) {
        return;
    }
    if (pKidObj->GetType() == PDFOBJ_NUMBER) {
        if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
            return;
        }
        pKid->m_Type = CPDF_StructKid::PageContent;
        pKid->m_PageContent.m_ContentId = pKidObj->GetInteger();
        pKid->m_PageContent.m_PageObjNum = PageObjNum;
        return;
    }
    if (pKidObj->GetType() != PDFOBJ_DICTIONARY) {
        return;
    }
    CPDF_Dictionary* pKidDict = (CPDF_Dictionary*)pKidObj;
    CPDF_Object* pPageObj = pKidDict->GetElement(FX_BSTRC("Pg"));
    if (pPageObj && pPageObj->GetType() == PDFOBJ_REFERENCE) {
        PageObjNum = ((CPDF_Reference*)pPageObj)->GetRefObjNum();
    }
    CFX_ByteString type = pKidDict->GetString(FX_BSTRC("Type"));
    if (type == FX_BSTRC("MCR")) {
        if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
            return;
        }
        pKid->m_Type = CPDF_StructKid::StreamContent;
        CPDF_Object* pStreamObj = pKidDict->GetElement(FX_BSTRC("Stm"));
        if (pStreamObj && pStreamObj->GetType() == PDFOBJ_REFERENCE) {
            pKid->m_StreamContent.m_RefObjNum = ((CPDF_Reference*)pStreamObj)->GetRefObjNum();
        } else {
            pKid->m_StreamContent.m_RefObjNum = 0;
        }
        pKid->m_StreamContent.m_PageObjNum = PageObjNum;
        pKid->m_StreamContent.m_ContentId = pKidDict->GetInteger(FX_BSTRC("MCID"));
    } else if (type == FX_BSTRC("OBJR")) {
        if (m_pTree->m_pPage && m_pTree->m_pPage->GetObjNum() != PageObjNum) {
            return;
        }
        pKid->m_Type = CPDF_StructKid::Object;
        CPDF_Object* pObj = pKidDict->GetElement(FX_BSTRC("Obj"));
        if (pObj && pObj->GetType() == PDFOBJ_REFERENCE) {
            pKid->m_Object.m_RefObjNum = ((CPDF_Reference*)pObj)->GetRefObjNum();
        } else {
            pKid->m_Object.m_RefObjNum = 0;
        }
        pKid->m_Object.m_PageObjNum = PageObjNum;
    } else {
        pKid->m_Type = CPDF_StructKid::Element;
        pKid->m_Element.m_pDict = pKidDict;
        if (m_pTree->m_pPage == NULL) {
            pKid->m_Element.m_pElement = FX_NEW CPDF_StructElementImpl(m_pTree, this, pKidDict);
        } else {
            pKid->m_Element.m_pElement = NULL;
        }
    }
}
开发者ID:151706061,项目名称:PDFium,代码行数:59,代码来源:doc_tagged.cpp

示例4: NumCopies

int32_t CPDF_ViewerPreferences::NumCopies() const {
  CPDF_Dictionary* pDict = m_pDoc->GetRoot();
  pDict = pDict->GetDict(FX_BSTRC("ViewerPreferences"));
  if (!pDict) {
    return 1;
  }
  return pDict->GetInteger(FX_BSTRC("NumCopies"));
}
开发者ID:azunite,项目名称:libpdfium,代码行数:8,代码来源:doc_viewerPreferences.cpp

示例5:

DLLEXPORT int STDCALL FPDF_GetSecurityHandlerRevision(FPDF_DOCUMENT document)
{
    if (document == NULL) return -1;
    CPDF_Document*pDoc = (CPDF_Document*)document;
    CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser();
    CPDF_Dictionary* pDict = pParser->GetEncryptDict();
    if (pDict == NULL) return -1;

    return pDict->GetInteger("R");
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:10,代码来源:fpdfview.cpp

示例6:

// jabdelmalek: changed return type from FX_DWORD to build on Linux (and match header).
DLLEXPORT unsigned long STDCALL FPDF_GetDocPermissions(FPDF_DOCUMENT document)
{
    if (document == NULL) return 0;
    CPDF_Document*pDoc = (CPDF_Document*)document;
    CPDF_Parser* pParser = 	(CPDF_Parser*)pDoc->GetParser();
    CPDF_Dictionary* pDict = pParser->GetEncryptDict();
    if (pDict == NULL) return (FX_DWORD)-1;

    return pDict->GetInteger("P");
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例7: LoadImageF

FX_BOOL CPDF_Image::LoadImageF(CPDF_Stream* pStream, FX_BOOL bInline) {
  m_pStream = pStream;
  if (m_bInline && m_pInlineDict) {
    m_pInlineDict->Release();
    m_pInlineDict = NULL;
  }
  m_bInline = bInline;
  CPDF_Dictionary* pDict = pStream->GetDict();
  if (m_bInline) {
    m_pInlineDict = ToDictionary(pDict->Clone());
  }
  m_pOC = pDict->GetDict(FX_BSTRC("OC"));
  m_bIsMask = !pDict->KeyExist(FX_BSTRC("ColorSpace")) ||
              pDict->GetInteger(FX_BSTRC("ImageMask"));
  m_bInterpolate = pDict->GetInteger(FX_BSTRC("Interpolate"));
  m_Height = pDict->GetInteger(FX_BSTRC("Height"));
  m_Width = pDict->GetInteger(FX_BSTRC("Width"));
  return TRUE;
}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:19,代码来源:fpdf_page_image.cpp

示例8: LoadTransInfo

void CPDF_PageObjects::LoadTransInfo()
{
    if (m_pFormDict == NULL) {
        return;
    }
    CPDF_Dictionary* pGroup = m_pFormDict->GetDict(FX_BSTRC("Group"));
    if (pGroup == NULL) {
        return;
    }
    if (pGroup->GetString(FX_BSTRC("S")) != FX_BSTRC("Transparency")) {
        return;
    }
    m_Transparency |= PDFTRANS_GROUP;
    if (pGroup->GetInteger(FX_BSTRC("I"))) {
        m_Transparency |= PDFTRANS_ISOLATED;
    }
    if (pGroup->GetInteger(FX_BSTRC("K"))) {
        m_Transparency |= PDFTRANS_KNOCKOUT;
    }
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:20,代码来源:fpdf_page.cpp

示例9: Load

FX_BOOL CPDF_MeshStream::Load(CPDF_Stream* pShadingStream, CPDF_Function** pFuncs, int nFuncs, CPDF_ColorSpace* pCS)
{
    m_Stream.LoadAllData(pShadingStream);
    m_BitStream.Init(m_Stream.GetData(), m_Stream.GetSize());
    m_pFuncs = pFuncs;
    m_nFuncs = nFuncs;
    m_pCS = pCS;
    CPDF_Dictionary* pDict = pShadingStream->GetDict();
    m_nCoordBits = pDict->GetInteger(FX_BSTRC("BitsPerCoordinate"));
    m_nCompBits = pDict->GetInteger(FX_BSTRC("BitsPerComponent"));
    m_nFlagBits = pDict->GetInteger(FX_BSTRC("BitsPerFlag"));
    if (!m_nCoordBits || !m_nCompBits) {
        return FALSE;
    }
    int nComps = pCS->CountComponents();
    if (nComps > 8) {
        return FALSE;
    }
    m_nComps = nFuncs ? 1 : nComps;
    if (((int)m_nComps < 0) || m_nComps > 8) {
        return FALSE;
    }
    m_CoordMax = m_nCoordBits == 32 ? -1 : (1 << m_nCoordBits) - 1;
    m_CompMax = (1 << m_nCompBits) - 1;
    CPDF_Array* pDecode = pDict->GetArray(FX_BSTRC("Decode"));
    if (pDecode == NULL || pDecode->GetCount() != 4 + m_nComps * 2) {
        return FALSE;
    }
    m_xmin = pDecode->GetNumber(0);
    m_xmax = pDecode->GetNumber(1);
    m_ymin = pDecode->GetNumber(2);
    m_ymax = pDecode->GetNumber(3);
    for (FX_DWORD i = 0; i < m_nComps; i ++) {
        m_ColorMin[i] = pDecode->GetNumber(i * 2 + 4);
        m_ColorMax[i] = pDecode->GetNumber(i * 2 + 5);
    }
    return TRUE;
}
开发者ID:151706061,项目名称:PDFium,代码行数:38,代码来源:fpdf_page_pattern.cpp

示例10: InsertDeletePDFPage

static int InsertDeletePDFPage(CPDF_Document* pDoc,
                               CPDF_Dictionary* pPages,
                               int nPagesToGo,
                               CPDF_Dictionary* pPage,
                               FX_BOOL bInsert,
                               CFX_ArrayTemplate<CPDF_Dictionary*>& stackList) {
  CPDF_Array* pKidList = pPages->GetArray("Kids");
  if (!pKidList) {
    return -1;
  }
  int nKids = pKidList->GetCount();
  for (int i = 0; i < nKids; i++) {
    CPDF_Dictionary* pKid = pKidList->GetDict(i);
    if (pKid->GetString("Type") == "Page") {
      if (nPagesToGo == 0) {
        if (bInsert) {
          pKidList->InsertAt(i, new CPDF_Reference(pDoc, pPage->GetObjNum()));
          pPage->SetAtReference("Parent", pDoc, pPages->GetObjNum());
        } else {
          pKidList->RemoveAt(i);
        }
        pPages->SetAtInteger("Count",
                             pPages->GetInteger("Count") + (bInsert ? 1 : -1));
        return 1;
      }
      nPagesToGo--;
    } else {
      int nPages = pKid->GetInteger("Count");
      if (nPagesToGo < nPages) {
        int stackCount = stackList.GetSize();
        for (int j = 0; j < stackCount; ++j) {
          if (pKid == stackList[j]) {
            return -1;
          }
        }
        stackList.Add(pKid);
        if (InsertDeletePDFPage(pDoc, pKid, nPagesToGo, pPage, bInsert,
                                stackList) < 0) {
          return -1;
        }
        stackList.RemoveAt(stackCount);
        pPages->SetAtInteger("Count",
                             pPages->GetInteger("Count") + (bInsert ? 1 : -1));
        return 1;
      }
      nPagesToGo -= nPages;
    }
  }
  return 0;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:50,代码来源:fpdf_edit_doc.cpp

示例11: ASSERT

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

示例12: _LoadCryptInfo

static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict,
                              const CFX_ByteStringC& name,
                              int& cipher,
                              int& keylen) {
  int Version = pEncryptDict->GetInteger(FX_BSTRC("V"));
  cipher = FXCIPHER_RC4;
  keylen = 0;
  if (Version >= 4) {
    CPDF_Dictionary* pCryptFilters = pEncryptDict->GetDict(FX_BSTRC("CF"));
    if (pCryptFilters == NULL) {
      return FALSE;
    }
    if (name == FX_BSTRC("Identity")) {
      cipher = FXCIPHER_NONE;
    } else {
      CPDF_Dictionary* pDefFilter = pCryptFilters->GetDict(name);
      if (pDefFilter == NULL) {
        return FALSE;
      }
      int nKeyBits = 0;
      if (Version == 4) {
        nKeyBits = pDefFilter->GetInteger(FX_BSTRC("Length"), 0);
        if (nKeyBits == 0) {
          nKeyBits = pEncryptDict->GetInteger(FX_BSTRC("Length"), 128);
        }
      } else {
        nKeyBits = pEncryptDict->GetInteger(FX_BSTRC("Length"), 256);
      }
      if (nKeyBits < 40) {
        nKeyBits *= 8;
      }
      keylen = nKeyBits / 8;
      CFX_ByteString cipher_name = pDefFilter->GetString(FX_BSTRC("CFM"));
      if (cipher_name == FX_BSTRC("AESV2") ||
          cipher_name == FX_BSTRC("AESV3")) {
        cipher = FXCIPHER_AES;
      }
    }
  } else {
    keylen =
        Version > 1 ? pEncryptDict->GetInteger(FX_BSTRC("Length"), 40) / 8 : 5;
  }
  if (keylen > 32 || keylen < 0) {
    return FALSE;
  }
  return TRUE;
}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:47,代码来源:fpdf_parser_encrypt.cpp

示例13: GetPattern

CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj, FX_BOOL bShading, const CFX_AffineMatrix* matrix)
{
    if (!pPatternObj) {
        return NULL;
    }
    CPDF_CountedObject<CPDF_Pattern*>* ptData = NULL;
    if (m_PatternMap.Lookup(pPatternObj, ptData)) {
        if (ptData->m_Obj) {
            ptData->m_nCount++;
            return ptData->m_Obj;
        }
    }
    FX_BOOL bNew = FALSE;
    if (!ptData) {
        ptData = FX_NEW CPDF_CountedObject<CPDF_Pattern*>;
        bNew = TRUE;
        if (!ptData) {
            return NULL;
        }
    }
    CPDF_Pattern* pPattern = NULL;
    if (bShading) {
        pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, bShading, matrix);
    } else {
        CPDF_Dictionary* pDict = pPatternObj ? pPatternObj->GetDict() : NULL;
        if (pDict) {
            int type = pDict->GetInteger(FX_BSTRC("PatternType"));
            if (type == 1) {
                pPattern = FX_NEW CPDF_TilingPattern(m_pPDFDoc, pPatternObj, matrix);
            } else if (type == 2) {
                pPattern = FX_NEW CPDF_ShadingPattern(m_pPDFDoc, pPatternObj, FALSE, matrix);
            }
        }
    }
    if (!pPattern) {
        if (bNew) {
            delete ptData;
        }
        return NULL;
    }
    ptData->m_nCount = 2;
    ptData->m_Obj = pPattern;
    m_PatternMap.SetAt(pPatternObj, ptData);
    return pPattern;
}
开发者ID:Gottox,项目名称:pdfium,代码行数:45,代码来源:fpdf_page_doc.cpp

示例14: GetMaxLen

int CPDF_FormField::GetMaxLen() {
  CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "MaxLen");
  if (pObj == NULL) {
    int iCount = m_ControlList.GetSize();
    for (int i = 0; i < iCount; i++) {
      CPDF_FormControl* pControl = (CPDF_FormControl*)m_ControlList.GetAt(i);
      if (pControl == NULL) {
        continue;
      }
      CPDF_Dictionary* pWidgetDict = pControl->m_pWidgetDict;
      if (pWidgetDict->KeyExist("MaxLen")) {
        return pWidgetDict->GetInteger("MaxLen");
      }
    }
    return 0;
  }
  return pObj->GetInteger();
}
开发者ID:azunite,项目名称:libpdfium,代码行数:18,代码来源:doc_formfield.cpp

示例15: ParserAnnots

int ParserAnnots( CPDF_Document* pSourceDoc, CPDF_Dictionary * pPageDic, CPDF_RectArray * pRectArray, CPDF_ObjectArray * pObjectArray, int nUsage)
{
	if (!pSourceDoc || !pPageDic) return FLATTEN_FAIL;
	
	GetContentsRect( pSourceDoc, pPageDic, pRectArray );
	CPDF_Array* pAnnots = pPageDic->GetArray("Annots");
	if (pAnnots)
	{
		FX_DWORD dwSize = pAnnots->GetCount();
		
		for (int i = 0; i < (int)dwSize; i++)
		{
			CPDF_Object* pObj = pAnnots->GetElementValue(i);
			
			if (!pObj)continue;
			
			if (pObj->GetType() == PDFOBJ_DICTIONARY)
			{
				CPDF_Dictionary* pAnnotDic = (CPDF_Dictionary*)pObj;
				CFX_ByteString sSubtype = pAnnotDic->GetString("Subtype");
				if (sSubtype == "Popup")continue;

				int nAnnotFlag = pAnnotDic->GetInteger("F");

				if(nAnnotFlag & ANNOTFLAG_HIDDEN) 
					continue;
				if(nUsage == FLAT_NORMALDISPLAY)
				{
					if(nAnnotFlag & ANNOTFLAG_INVISIBLE)
						continue;
					ParserStream( pPageDic, pAnnotDic, pRectArray, pObjectArray );		
				}
				else
				{
					if(nAnnotFlag & ANNOTFLAG_PRINT)
						ParserStream( pPageDic, pAnnotDic, pRectArray, pObjectArray );
				}			
			}
		}
		return FLATTEN_SUCCESS;
	}else{
		return FLATTEN_NOTINGTODO;
	}
}
开发者ID:azunite,项目名称:pdfium_ch,代码行数:44,代码来源:fpdf_flatten.cpp


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