本文整理汇总了C++中CPDF_Dictionary::SetAtRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_Dictionary::SetAtRect方法的具体用法?C++ CPDF_Dictionary::SetAtRect怎么用?C++ CPDF_Dictionary::SetAtRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_Dictionary
的用法示例。
在下文中一共展示了CPDF_Dictionary::SetAtRect方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WriteAppearance
void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType,
const CPDF_Rect& rcBBox,
const CFX_Matrix& matrix,
const CFX_ByteString& sContents,
const CFX_ByteString& sAPState) {
CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictBy("AP");
if (!pAPDict) {
pAPDict = new CPDF_Dictionary;
m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict);
}
CPDF_Stream* pStream = nullptr;
CPDF_Dictionary* pParentDict = nullptr;
if (sAPState.IsEmpty()) {
pParentDict = pAPDict;
pStream = pAPDict->GetStreamBy(sAPType);
} else {
CPDF_Dictionary* pAPTypeDict = pAPDict->GetDictBy(sAPType);
if (!pAPTypeDict) {
pAPTypeDict = new CPDF_Dictionary;
pAPDict->SetAt(sAPType, pAPTypeDict);
}
pParentDict = pAPTypeDict;
pStream = pAPTypeDict->GetStreamBy(sAPState);
}
if (!pStream) {
pStream = new CPDF_Stream(nullptr, 0, nullptr);
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
int32_t objnum = pDoc->AddIndirectObject(pStream);
pParentDict->SetAtReference(sAPType, pDoc, objnum);
}
CPDF_Dictionary* pStreamDict = pStream->GetDict();
if (!pStreamDict) {
pStreamDict = new CPDF_Dictionary;
pStreamDict->SetAtName("Type", "XObject");
pStreamDict->SetAtName("Subtype", "Form");
pStreamDict->SetAtInteger("FormType", 1);
pStream->InitStream(nullptr, 0, pStreamDict);
}
if (pStreamDict) {
pStreamDict->SetAtMatrix("Matrix", matrix);
pStreamDict->SetAtRect("BBox", rcBBox);
}
pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), FALSE,
FALSE);
}
示例2: ProcessForm
void CPDF_PageContentGenerate::ProcessForm(CFX_ByteTextBuf& buf,
const uint8_t* data,
FX_DWORD size,
CFX_Matrix& matrix) {
if (!data || !size) {
return;
}
CPDF_Stream* pStream = new CPDF_Stream(NULL, 0, NULL);
CPDF_Dictionary* pFormDict = CPDF_Dictionary::Create();
pFormDict->SetAtName("Type", "XObject");
pFormDict->SetAtName("Subtype", "Form");
CFX_FloatRect bbox = m_pPage->GetPageBBox();
matrix.TransformRect(bbox);
pFormDict->SetAtRect("BBox", bbox);
pStream->InitStream((uint8_t*)data, size, pFormDict);
buf << "q " << matrix << " cm ";
CFX_ByteString name = RealizeResource(pStream, "XObject");
buf << "/" << PDF_NameEncode(name) << " Do Q\n";
}
示例3: WriteAppearance
void CPDFSDK_Annot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox,
const CPDF_Matrix& matrix, const CFX_ByteString& sContents,
const CFX_ByteString& sAPState)
{
ASSERT(m_pAnnot != NULL);
ASSERT(m_pAnnot->m_pAnnotDict != NULL);
CPDF_Dictionary* pAPDict = m_pAnnot->m_pAnnotDict->GetDict("AP");
if (!pAPDict)
{
pAPDict = FX_NEW CPDF_Dictionary;
m_pAnnot->m_pAnnotDict->SetAt("AP", pAPDict);
}
CPDF_Stream* pStream = NULL;
CPDF_Dictionary* pParentDict = NULL;
if (sAPState.IsEmpty())
{
pParentDict = pAPDict;
pStream = pAPDict->GetStream(sAPType);
}
else
{
CPDF_Dictionary* pAPTypeDict = pAPDict->GetDict(sAPType);
if (!pAPTypeDict)
{
pAPTypeDict = FX_NEW CPDF_Dictionary;
pAPDict->SetAt(sAPType, pAPTypeDict);
}
pParentDict = pAPTypeDict;
pStream = pAPTypeDict->GetStream(sAPState);
}
if (!pStream)
{
ASSERT(m_pPageView != NULL);
CPDF_Document* pDoc = m_pPageView->GetPDFDocument();
ASSERT(pDoc != NULL);
pStream = FX_NEW CPDF_Stream(NULL, 0, NULL);
FX_INT32 objnum = pDoc->AddIndirectObject(pStream);
//pAPDict->SetAtReference(sAPType, pDoc, objnum);
ASSERT(pParentDict != NULL);
pParentDict->SetAtReference(sAPType, pDoc, objnum);
}
CPDF_Dictionary * pStreamDict = pStream->GetDict();
if (!pStreamDict)
{
pStreamDict = FX_NEW CPDF_Dictionary;
pStreamDict->SetAtName("Type", "XObject");
pStreamDict->SetAtName("Subtype", "Form");
pStreamDict->SetAtInteger("FormType", 1);
pStream->InitStream(NULL,0,pStreamDict);
}
if (pStreamDict)
{
pStreamDict->SetAtMatrix("Matrix",matrix);
pStreamDict->SetAtRect("BBox", rcBBox);
}
pStream->SetData((FX_BYTE*)sContents.c_str(), sContents.GetLength(), FALSE, FALSE);
}
示例4: if
//.........这里部分代码省略.........
}
CFX_ByteString key = "";
int nStreams = ObjectArray.GetSize();
if (nStreams > 0)
{
for (int iKey = 0; /*iKey < 100*/; iKey++)
{
char sExtend[5] = {0};
FXSYS_itoa(iKey, sExtend, 10);
key = CFX_ByteString("FFT") + CFX_ByteString(sExtend);
if (!pPageXObject->KeyExist(key))
break;
}
}
SetPageContents(key, pPageDict, pDocument);
CPDF_Dictionary* pNewXORes = NULL;
if (!key.IsEmpty())
{
pPageXObject->SetAtReference(key, pDocument, dwObjNum);
CPDF_Dictionary* pNewOXbjectDic = pNewXObject->GetDict();
pNewXORes = FX_NEW CPDF_Dictionary;
pNewOXbjectDic->SetAt("Resources", pNewXORes);
pNewOXbjectDic->SetAtName("Type", "XObject");
pNewOXbjectDic->SetAtName("Subtype", "Form");
pNewOXbjectDic->SetAtInteger("FormType", 1);
pNewOXbjectDic->SetAtName("Name", "FRM");
CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox");
pNewOXbjectDic->SetAtRect("BBox", rcBBox);
}
for (int i = 0; i < nStreams; i++)
{
CPDF_Dictionary* pAnnotDic = ObjectArray.GetAt(i);
if (!pAnnotDic)continue;
CPDF_Rect rcAnnot = pAnnotDic->GetRect("Rect");
rcAnnot.Normalize();
CFX_ByteString sAnnotState = pAnnotDic->GetString("AS");
CPDF_Dictionary* pAnnotAP = pAnnotDic->GetDict("AP");
if (!pAnnotAP)continue;
CPDF_Stream* pAPStream = pAnnotAP->GetStream("N");
if (!pAPStream)
{
CPDF_Dictionary* pAPDic = pAnnotAP->GetDict("N");
if (!pAPDic)continue;
if (!sAnnotState.IsEmpty())
{
pAPStream = pAPDic->GetStream(sAnnotState);
}
else
{
FX_POSITION pos = pAPDic->GetStartPos();
if (pos)
{
CFX_ByteString sKey;
CPDF_Object* pFirstObj = pAPDic->GetNextElement(pos, sKey);
if (pFirstObj)