本文整理汇总了C++中PdfObject::MustGetIndirectKey方法的典型用法代码示例。如果您正苦于以下问题:C++ PdfObject::MustGetIndirectKey方法的具体用法?C++ PdfObject::MustGetIndirectKey怎么用?C++ PdfObject::MustGetIndirectKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfObject
的用法示例。
在下文中一共展示了PdfObject::MustGetIndirectKey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getFontInfo
PDFFont PDFAnalyzer::getFontInfo(PdfObject* fontObj)
{
PDFFont currFont;
PdfObject* subtype = fontObj->GetIndirectKey("Subtype");
if (subtype && subtype->IsName())
{
PdfObject* fontDesc = fontObj->GetIndirectKey("FontDescriptor");
if (subtype->GetName() == "Type1")
currFont.fontType = F_Type1;
else if (subtype->GetName() == "MMType1")
currFont.fontType = F_MMType1;
else if (subtype->GetName() == "TrueType")
currFont.fontType = F_TrueType;
else if (subtype->GetName() == "Type3")
{
currFont.fontType = F_Type3;
currFont.isEmbedded = true;
fontDesc = NULL;
}
else if (subtype->GetName() == "Type0")
{
PdfObject* descendantFonts = fontObj->GetIndirectKey("DescendantFonts");
if (descendantFonts && descendantFonts->IsArray())
{
PdfObject descendantFont = descendantFonts->GetArray()[0];
descendantFont.SetOwner(descendantFonts->GetOwner());
PdfObject* subtypeDescFont = descendantFont.GetIndirectKey("Subtype");
fontDesc = descendantFont.MustGetIndirectKey("FontDescriptor");
if (subtypeDescFont && subtypeDescFont->IsName())
{
if (subtypeDescFont->GetName() == "CIDFontType0")
currFont.fontType = F_CIDFontType0;
else if (subtypeDescFont->GetName() == "CIDFontType2")
currFont.fontType = F_CIDFontType2;
}
}
}
if (fontDesc)
{
PdfObject* fontFile = fontDesc->GetIndirectKey("FontFile");
PdfObject* fontFile2 = fontDesc->GetIndirectKey("FontFile2");
PdfObject* fontFile3 = fontDesc->GetIndirectKey("FontFile3");
if (fontFile && fontFile->HasStream())
currFont.isEmbedded = true;
if (fontFile2 && fontFile2->HasStream())
currFont.isEmbedded = true;
if (fontFile3 && fontFile3->HasStream())
{
currFont.isEmbedded = true;
PdfObject* ff3Subtype = fontFile3->GetIndirectKey("Subtype");
if (ff3Subtype && ff3Subtype->IsName() && ff3Subtype->GetName() == "OpenType")
currFont.isOpenType = true;
}
}
}
return currFont;
}