本文整理汇总了C++中PDFDoc::getDocInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ PDFDoc::getDocInfo方法的具体用法?C++ PDFDoc::getDocInfo怎么用?C++ PDFDoc::getDocInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PDFDoc
的用法示例。
在下文中一共展示了PDFDoc::getDocInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: convert
//.........这里部分代码省略.........
OptionalContentGroup *oc = ocgGroups[a];
if (actL != UnicodeParsedString(oc->getName()))
currentLayer = m_Doc->addLayer(UnicodeParsedString(oc->getName()), false);
else
currentLayer = m_Doc->layerIDFromName(UnicodeParsedString(oc->getName()));
// POPPLER_VERSION appeared in 0.19.0 first
#ifdef POPPLER_VERSION
if ((oc->getViewState() == OptionalContentGroup::ocUsageOn) || (oc->getViewState() == OptionalContentGroup::ocUsageUnset))
m_Doc->setLayerVisible(currentLayer, true);
else
m_Doc->setLayerVisible(currentLayer, false);
if ((oc->getPrintState() == OptionalContentGroup::ocUsageOn) || (oc->getPrintState() == OptionalContentGroup::ocUsageUnset))
m_Doc->setLayerPrintable(currentLayer, true);
else
m_Doc->setLayerPrintable(currentLayer, false);
#else
if (oc->getState() == OptionalContentGroup::On)
{
m_Doc->setLayerVisible(currentLayer, true);
m_Doc->setLayerPrintable(currentLayer, true);
}
else
{
m_Doc->setLayerVisible(currentLayer, false);
m_Doc->setLayerPrintable(currentLayer, false);
}
#endif
oc->setState(OptionalContentGroup::Off);
}
dev->layersSetByOCG = true;
}
#endif
Object info;
pdfDoc->getDocInfo(&info);
if (info.isDict())
{
Object obj;
GooString *s1;
Dict *infoDict = info.getDict();
if (infoDict->lookup((char*)"Title", &obj )->isString())
{
s1 = obj.getString();
m_Doc->documentInfo().setTitle(UnicodeParsedString(obj.getString()));
obj.free();
}
if (infoDict->lookup((char*)"Author", &obj )->isString())
{
s1 = obj.getString();
m_Doc->documentInfo().setAuthor(UnicodeParsedString(obj.getString()));
obj.free();
}
if (infoDict->lookup((char*)"Subject", &obj )->isString())
{
s1 = obj.getString();
m_Doc->documentInfo().setSubject(UnicodeParsedString(obj.getString()));
obj.free();
}
if (infoDict->lookup((char*)"Keywords", &obj )->isString())
{
s1 = obj.getString();
m_Doc->documentInfo().setKeywords(UnicodeParsedString(obj.getString()));
obj.free();
}
}
info.free();
for (int pp = 0; pp < lastPage; pp++)