本文整理汇总了C++中PdfObject::IsReal方法的典型用法代码示例。如果您正苦于以下问题:C++ PdfObject::IsReal方法的具体用法?C++ PdfObject::IsReal怎么用?C++ PdfObject::IsReal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PdfObject
的用法示例。
在下文中一共展示了PdfObject::IsReal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: inspectExtGStateObj
void PDFAnalyzer::inspectExtGStateObj(PdfObject* extGStateObj, QList<PDFColorSpace> & usedColorSpaces, bool & hasTransparency, QList<PDFFont> & usedFonts, PDFGraphicState & currGS)
{
PdfObject* bmObj = extGStateObj->GetIndirectKey("BM");
if (bmObj && bmObj->IsName())
{
currGS.blendModes.clear();
currGS.blendModes.append(bmObj->GetName().GetEscapedName().c_str());
if (!(bmObj->GetName() == "Normal" || bmObj->GetName() == "Compatible"))
hasTransparency = true;
}
else if (bmObj && bmObj->IsArray())
{
PdfArray arr = bmObj->GetArray();
currGS.blendModes.clear();
for(int i=0; i<arr.GetSize(); ++i)
currGS.blendModes.append(arr[i].GetName().GetEscapedName().c_str());
if (arr[0].IsName() && !(arr[0].GetName() == "Normal" || arr[0].GetName() == "Compatible"))
hasTransparency = true;
}
PdfObject* caObj = extGStateObj->GetIndirectKey("ca");
if (caObj && (caObj->IsReal() || caObj->IsNumber()))
{
currGS.fillAlphaConstant = caObj->GetReal();
if (caObj->GetReal() < 1)
hasTransparency = true;
}
PdfObject* cAObj = extGStateObj->GetIndirectKey("CA");
if (cAObj && (cAObj->IsReal() || cAObj->IsNumber()))
{
if (cAObj->GetReal() < 1)
hasTransparency = true;
}
PdfObject* sMaskObj = extGStateObj->GetIndirectKey("SMask");
if (sMaskObj && !(sMaskObj->IsName() && sMaskObj->GetName() == "None"))
hasTransparency = true;
PdfObject* fontObj = extGStateObj->GetIndirectKey("Font");
if (fontObj && fontObj->IsArray())
{
PdfArray arr = fontObj->GetArray();
if (arr[0].IsReference())
{
PdfReference ref = arr[0].GetReference();
PdfObject* fontObject = m_doc->GetObjects().GetObject(ref);
if (fontObject)
{
PDFFont font = getFontInfo(fontObject);
usedFonts.append(font);
currGS.font.first = font;
currGS.font.second = arr[1].GetReal();
}
}
}
PdfObject* lwObj = extGStateObj->GetIndirectKey("LW");
if (lwObj)
currGS.lineWidth = lwObj->GetReal();
PdfObject* lcObj = extGStateObj->GetIndirectKey("LC");
if (lcObj)
currGS.lineCap = lcObj->GetNumber();
PdfObject* ljObj = extGStateObj->GetIndirectKey("LJ");
if (ljObj)
currGS.lineJoin = ljObj->GetNumber();
PdfObject* mlObj = extGStateObj->GetIndirectKey("ML");
if (mlObj)
currGS.miterLimit = mlObj->GetReal();
PdfObject* dObj = extGStateObj->GetIndirectKey("D");
if (dObj)
{
PdfArray dashArr = dObj->GetArray()[0];
currGS.dashPattern.first.clear();
for (int i=0; i<dashArr.GetSize(); ++i)
currGS.dashPattern.first.append(dashArr[i].GetNumber());
currGS.dashPattern.second = dObj->GetArray()[1].GetNumber();
}
}