本文整理汇总了C++中CPDF_Dictionary::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Dictionary::GetType方法的具体用法?C++ CPDF_Dictionary::GetType怎么用?C++ CPDF_Dictionary::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Dictionary
的用法示例。
在下文中一共展示了CPDF_Dictionary::GetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ASSERT
CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
{
ASSERT(pPage != NULL);
m_pPageDict = pPage->m_pFormDict;
if (m_pPageDict == NULL) {
return;
}
m_pDocument = pPage->m_pDocument;
CPDF_Array* pAnnots = m_pPageDict->GetArray("Annots");
if (pAnnots == NULL) {
return;
}
CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
CPDF_Dictionary* pAcroForm = pRoot->GetDict("AcroForm");
FX_BOOL bRegenerateAP = pAcroForm && pAcroForm->GetBoolean("NeedAppearances");
for (FX_DWORD i = 0; i < pAnnots->GetCount(); i ++) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) {
continue;
}
FX_DWORD dwObjNum = pDict->GetObjNum();
if (dwObjNum == 0) {
dwObjNum = m_pDocument->AddIndirectObject(pDict);
CPDF_Reference* pAction = CPDF_Reference::Create(m_pDocument, dwObjNum);
if (pAction == NULL) {
break;
}
pAnnots->InsertAt(i, pAction);
pAnnots->RemoveAt(i + 1);
pDict = pAnnots->GetDict(i);
}
CPDF_Annot* pAnnot = FX_NEW CPDF_Annot(pDict);
if (pAnnot == NULL) {
break;
}
pAnnot->m_pList = this;
m_AnnotList.Add(pAnnot);
if (bRegenerateAP && pDict->GetConstString(FX_BSTRC("Subtype")) == FX_BSTRC("Widget"))
if (CPDF_InterForm::UpdatingAPEnabled()) {
FPDF_GenerateAP(m_pDocument, pDict);
}
}
}
示例2: ParseStream
void CFDF_Document::ParseStream(IFX_FileRead *pFile, FX_BOOL bOwnFile)
{
m_pFile = pFile;
m_bOwnFile = bOwnFile;
CPDF_SyntaxParser parser;
parser.InitParser(m_pFile, 0);
while (1) {
FX_BOOL bNumber;
CFX_ByteString word = parser.GetNextWord(bNumber);
if (bNumber) {
FX_DWORD objnum = FXSYS_atoi(word);
word = parser.GetNextWord(bNumber);
if (!bNumber) {
break;
}
word = parser.GetNextWord(bNumber);
if (word != FX_BSTRC("obj")) {
break;
}
CPDF_Object* pObj = parser.GetObject(this, objnum, 0, FALSE);
if (pObj == NULL) {
break;
}
InsertIndirectObject(objnum, pObj);
word = parser.GetNextWord(bNumber);
if (word != FX_BSTRC("endobj")) {
break;
}
} else {
if (word != FX_BSTRC("trailer")) {
break;
}
CPDF_Dictionary* pMainDict = (CPDF_Dictionary*)parser.GetObject(this, 0, 0, 0);
if (pMainDict == NULL || pMainDict->GetType() != PDFOBJ_DICTIONARY) {
break;
}
m_pRootDict = pMainDict->GetDict(FX_BSTRC("Root"));
pMainDict->Release();
break;
}
}
}
示例3:
DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FPDF_LINK* linkAnnot)
{
if(!page || !startPos || !linkAnnot)
return FALSE;
CPDF_Page* pPage = (CPDF_Page*)page;
if(!pPage->m_pFormDict) return FALSE;
CPDF_Array* pAnnots = pPage->m_pFormDict->GetArray("Annots");
if(!pAnnots) return FALSE;
for (int i = *startPos; i < (int)pAnnots->GetCount(); i ++) {
CPDF_Dictionary* pDict = (CPDF_Dictionary*)pAnnots->GetElementValue(i);
if (pDict == NULL || pDict->GetType() != PDFOBJ_DICTIONARY) continue;
if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link")))
{
*startPos = i+1;
*linkAnnot = (FPDF_LINK)pDict;
return TRUE;
}
}
return FALSE;
}