本文整理汇总了C++中PdfObject::SetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ PdfObject::SetOwner方法的具体用法?C++ PdfObject::SetOwner怎么用?C++ PdfObject::SetOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfObject
的用法示例。
在下文中一共展示了PdfObject::SetOwner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getCSType
PDFColorSpace PDFAnalyzer::getCSType(PdfObject* cs)
{
try {
// colorspace is either a name or an array
if (cs && cs->IsName())
{
PdfName csName = cs->GetName();
if (csName == "DeviceGray")
return CS_DeviceGray;
else if (csName == "DeviceRGB")
return CS_DeviceRGB;
else if (csName == "DeviceCMYK")
return CS_DeviceCMYK;
}
else if (cs && cs->IsArray())
{
PdfArray csArr = cs->GetArray();
PdfObject csTypePdfName = csArr[0];
if (csTypePdfName.IsName())
{
PdfName csTypeName = csTypePdfName.GetName();
if (csTypeName == "ICCBased")
return CS_ICCBased;
else if (csTypeName == "CalGray")
return CS_CalGray;
else if (csTypeName == "CalRGB")
return CS_CalRGB;
else if (csTypeName == "Lab")
return CS_Lab;
else if (csTypeName == "Indexed")
{
PdfObject base = cs->GetArray()[1];
PdfObject* pBase = &base;
if (base.IsReference())
{
pBase = cs->GetOwner()->GetObject(base.GetReference());
}
pBase->SetOwner(cs->GetOwner());
return getCSType(pBase);
}
else if (csTypeName == "Separation")
return CS_Separation;
else if (csTypeName == "DeviceN")
return CS_DeviceN;
else if (csTypeName == "Pattern")
return CS_Pattern;
}
}
}
catch (PdfError & e)
{
qDebug() << "Error in identifying the color type";
e.PrintErrorMsg();
return CS_Unknown;
}
return CS_Unknown;
}
示例2: 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;
}
示例3: CreateObject
PdfObject* PdfVecObjects::CreateObject( const PdfVariant & rVariant )
{
PdfReference ref = this->GetNextFreeObject();
PdfObject* pObj = new PdfObject( ref, rVariant );
pObj->SetOwner( this );
this->push_back( pObj );
return pObj;
}