本文整理汇总了C++中CPDF_Dictionary::SetRectFor方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Dictionary::SetRectFor方法的具体用法?C++ CPDF_Dictionary::SetRectFor怎么用?C++ CPDF_Dictionary::SetRectFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Dictionary
的用法示例。
在下文中一共展示了CPDF_Dictionary::SetRectFor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessForm
void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf,
const uint8_t* data,
uint32_t size,
CFX_Matrix& matrix) {
if (!data || !size)
return;
CPDF_Dictionary* pFormDict =
new CPDF_Dictionary(m_pDocument->GetByteStringPool());
pFormDict->SetNameFor("Type", "XObject");
pFormDict->SetNameFor("Subtype", "Form");
CFX_FloatRect bbox = m_pPage->GetPageBBox();
matrix.TransformRect(bbox);
pFormDict->SetRectFor("BBox", bbox);
CPDF_Stream* pStream = new CPDF_Stream;
pStream->InitStream(data, size, pFormDict);
buf << "q " << matrix << " cm ";
CFX_ByteString name = RealizeResource(pStream, "XObject");
buf << "/" << PDF_NameEncode(name) << " Do Q\n";
}
示例2: if
//.........这里部分代码省略.........
CPDF_Dictionary* pPageXObject = pRes->GetDictFor("XObject");
if (!pPageXObject) {
pPageXObject = new CPDF_Dictionary(pDocument->GetByteStringPool());
pRes->SetFor("XObject", pPageXObject);
}
CFX_ByteString key = "";
int nStreams = ObjectArray.GetSize();
if (nStreams > 0) {
for (int iKey = 0; /*iKey < 100*/; iKey++) {
char sExtend[5] = {};
FXSYS_itoa(iKey, sExtend, 10);
key = CFX_ByteString("FFT") + CFX_ByteString(sExtend);
if (!pPageXObject->KeyExist(key))
break;
}
}
SetPageContents(key, pPageDict, pDocument);
CPDF_Dictionary* pNewXORes = nullptr;
if (!key.IsEmpty()) {
pPageXObject->SetReferenceFor(key, pDocument, dwObjNum);
CPDF_Dictionary* pNewOXbjectDic = pNewXObject->GetDict();
pNewXORes = new CPDF_Dictionary(pDocument->GetByteStringPool());
pNewOXbjectDic->SetFor("Resources", pNewXORes);
pNewOXbjectDic->SetNameFor("Type", "XObject");
pNewOXbjectDic->SetNameFor("Subtype", "Form");
pNewOXbjectDic->SetIntegerFor("FormType", 1);
pNewOXbjectDic->SetNameFor("Name", "FRM");
CFX_FloatRect rcBBox = pPageDict->GetRectFor("ArtBox");
pNewOXbjectDic->SetRectFor("BBox", rcBBox);
}
for (int i = 0; i < nStreams; i++) {
CPDF_Dictionary* pAnnotDic = ObjectArray.GetAt(i);
if (!pAnnotDic)
continue;
CFX_FloatRect rcAnnot = pAnnotDic->GetRectFor("Rect");
rcAnnot.Normalize();
CFX_ByteString sAnnotState = pAnnotDic->GetStringFor("AS");
CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDictFor("AP");
if (!pAnnotAP)
continue;
CPDF_Stream* pAPStream = pAnnotAP->GetStreamFor("N");
if (!pAPStream) {
CPDF_Dictionary* pAPDic = pAnnotAP->GetDictFor("N");
if (!pAPDic)
continue;
if (!sAnnotState.IsEmpty()) {
pAPStream = pAPDic->GetStreamFor(sAnnotState);
} else {
auto it = pAPDic->begin();
if (it != pAPDic->end()) {
CPDF_Object* pFirstObj = it->second;
if (pFirstObj) {
if (pFirstObj->IsReference())
pFirstObj = pFirstObj->GetDirect();
if (!pFirstObj->IsStream())
continue;