本文整理汇总了C++中CPDF_PageObject::AsImage方法的典型用法代码示例。如果您正苦于以下问题:C++ CPDF_PageObject::AsImage方法的具体用法?C++ CPDF_PageObject::AsImage怎么用?C++ CPDF_PageObject::AsImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPDF_PageObject
的用法示例。
在下文中一共展示了CPDF_PageObject::AsImage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: pPageObjHolder
DLLEXPORT void STDCALL FPDFPage_InsertObject(FPDF_PAGE page,
FPDF_PAGEOBJECT page_obj) {
CPDF_PageObject* pPageObj = reinterpret_cast<CPDF_PageObject*>(page_obj);
if (!pPageObj)
return;
std::unique_ptr<CPDF_PageObject> pPageObjHolder(pPageObj);
CPDF_Page* pPage = CPDFPageFromFPDFPage(page);
if (!IsPageObject(pPage))
return;
pPage->GetPageObjectList()->push_back(std::move(pPageObjHolder));
switch (pPageObj->GetType()) {
case CPDF_PageObject::TEXT: {
break;
}
case CPDF_PageObject::PATH: {
CPDF_PathObject* pPathObj = pPageObj->AsPath();
pPathObj->CalcBoundingBox();
break;
}
case CPDF_PageObject::IMAGE: {
CPDF_ImageObject* pImageObj = pPageObj->AsImage();
pImageObj->CalcBoundingBox();
break;
}
case CPDF_PageObject::SHADING: {
CPDF_ShadingObject* pShadingObj = pPageObj->AsShading();
pShadingObj->CalcBoundingBox();
break;
}
case CPDF_PageObject::FORM: {
CPDF_FormObject* pFormObj = pPageObj->AsForm();
pFormObj->CalcBoundingBox();
break;
}
default: {
ASSERT(false);
break;
}
}
}
示例2: GenerateContent
void CPDF_PageContentGenerator::GenerateContent() {
CFX_ByteTextBuf buf;
CPDF_Dictionary* pPageDict = m_pPage->m_pFormDict;
for (int i = 0; i < m_pageObjects.GetSize(); ++i) {
CPDF_PageObject* pPageObj = m_pageObjects[i];
if (!pPageObj || !pPageObj->IsImage()) {
continue;
}
ProcessImage(buf, pPageObj->AsImage());
}
CPDF_Object* pContent =
pPageDict ? pPageDict->GetDirectObjectFor("Contents") : nullptr;
if (pContent)
pPageDict->RemoveFor("Contents");
CPDF_Stream* pStream = new CPDF_Stream;
pStream->SetData(buf.GetBuffer(), buf.GetLength());
pPageDict->SetReferenceFor("Contents", m_pDocument,
m_pDocument->AddIndirectObject(pStream));
}