pdfium
class CPDF_TestDocumentForPages : public CPDF_Document {
public:
CPDF_TestDocumentForPages() : CPDF_Document(nullptr) {
// Set up test
auto zeroToTwo = pdfium::MakeUnique<CPDF_Array>();
zeroToTwo->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(0))->GetObjNum());
zeroToTwo->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(1))->GetObjNum());
zeroToTwo->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(2))->GetObjNum());
CPDF_Dictionary* branch1 =
CreatePageTreeNode(std::move(zeroToTwo), this, 3); auto zeroToThree = pdfium::MakeUnique<CPDF_Array>();
zeroToThree->AddNew<CPDF_Reference>(this, branch1->GetObjNum());
zeroToThree->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(3))->GetObjNum());
CPDF_Dictionary* branch2 =
CreatePageTreeNode(std::move(zeroToThree), this, 4); auto fourFive = pdfium::MakeUnique<CPDF_Array>();
fourFive->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(4))->GetObjNum());
fourFive->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(5))->GetObjNum());
CPDF_Dictionary* branch3 = CreatePageTreeNode(std::move(fourFive), this, 2); auto justSix = pdfium::MakeUnique<CPDF_Array>();
justSix->AddNew<CPDF_Reference>(
this, AddIndirectObject(CreateNumberedPage(6))->GetObjNum());
CPDF_Dictionary* branch4 = CreatePageTreeNode(std::move(justSix), this, 1); auto allPages = pdfium::MakeUnique<CPDF_Array>();
allPages->AddNew<CPDF_Reference>(this, branch2->GetObjNum());
allPages->AddNew<CPDF_Reference>(this, branch3->GetObjNum());
allPages->AddNew<CPDF_Reference>(this, branch4->GetObjNum());
CPDF_Dictionary* pagesDict =
CreatePageTreeNode(std::move(allPages), this, 7); m_pOwnedRootDict = pdfium::MakeUnique<CPDF_Dictionary>();
m_pOwnedRootDict->SetNewFor<CPDF_Reference>("Pages", this,
pagesDict->GetObjNum());
m_pRootDict = m_pOwnedRootDict.get();
m_PageList.resize(7);
} private:
std::unique_ptr<CPDF_Dictionary> m_pOwnedRootDict;
};
继承自
CPDF_Document 内容
<CPDF_Dictionary
pdfium的更多相关文章
- 福昕熊雨前:PDFium开源项目的背后
今天编译android的时候,无意中看到命令行提示出输出编译external/pdfium这个目录,于是乎上百度搜索了一下,找到了如下关于PDF文件解析的开源代码的文章: http://www.csd ...
- pdfium ppm demo
#include "fpdfview.h" #include <iostream> #include <string> #include <strin ...
- pdfium 代码执行流程
1.FPDF_InitLibrary(NULL); CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess) { i ...
- pdfium舍弃v8依赖
Step 3 去除v8依赖 用文本编辑器打开pdfium根目录下的pdfium.gyp文件,找到'javascript'及'jsapi'依赖(47行左右): 'dependencies': [ 'sa ...
- pdfium 之二
https://www.foxitsoftware.cn/products/premium-pdfium/feature.php 基于谷歌PDFium开源代码 谷歌采用福昕的PDF技术为其PDF开源项 ...
- PDFium 渲染
PDFium 是 Chromium 的 PDF 渲染引擎,许可协议为 BSD 3-Clause.不同于 Mozilla 基于 HTML5 的 PDF.js,PDFium 是基于 Foxit Softw ...
- ubuntu pdfium
dept_tool export PATH=`pwd`/depot_tools:"$PATH" gn工具在内
- pdfium 例子
#include <stdio.h> #include <fpdfview.h> int main(int argc, char** argv) { FPDF_InitLibr ...
- pdfium 保存pdf
// // Created by svenj on 2019/2/3. // extern "C" { #include <unistd.h> #include < ...
随机推荐
- luoguP3071 [USACO13JAN]座位Seating
https://www.luogu.org/problem/P3071 AC代码: https://www.luogu.org/blog/user33426/solution-p3071 莫名其妙RE ...
- 【PL/SQL】设置F8自动运行
- 小白专场-FileTransfer-python语言实现
目录 更新.更全的<数据结构与算法>的更新网站,更有python.go.人工智能教学等着你:https://www.cnblogs.com/nickchen121/p/11407287.h ...
- 【转】np.random.random()函数 参数用法以及numpy.random系列函数大全
转自:https://www.cnblogs.com/DOMLX/p/9751471.html 1.np.random.random()函数参数 np.random.random((1000, 20) ...
- vue 路由跳转到本页面,ts 监听路由变化
@Watch('$route') routechange(to: any, from: any) { //参数不相等 if (to.query.name!=from.query.name) { //t ...
- Visual Studio 2015 Tools for Unity使用基础
Unity4.x编辑器侧 具体版本号:Visual Studio 2015 Tools for Unity 3.7.0.1 该插件在:Microsoft Visual Studio Tools for ...
- jQuery 源码解析(七) jQuery对象和DOM对象的互相转换
jQuery对象是一个类数组对象,它保存的是对应的DOM的引用,我们可以直接用[]获取某个索引内的DOM节点,也可以用get方法获取某个索引内的DOM节点,还可以用toArray()方法把jQuery ...
- CodeForces - 560D Equivalent Strings
Today on a lecture about strings Gerald learned a new definition of string equivalency. Two strings ...
- WPF --TextBox--圆角、水印、带单位
<SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3"/> <Sol ...
- maplotlib画柱状图并添加标签
import json from collections import Counter import matplotlib.pyplot as plt import matplotlib as mpl ...