https://github.com/SubtleCow/AccessControlListsintheDOM/tree/4673d995e5614bc682cecd22f9b2919b23602735/src/pdf/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的更多相关文章

  1. 福昕熊雨前:PDFium开源项目的背后

    今天编译android的时候,无意中看到命令行提示出输出编译external/pdfium这个目录,于是乎上百度搜索了一下,找到了如下关于PDF文件解析的开源代码的文章: http://www.csd ...

  2. pdfium ppm demo

    #include "fpdfview.h" #include <iostream> #include <string> #include <strin ...

  3. pdfium 代码执行流程

    1.FPDF_InitLibrary(NULL); CPDF_CustomAccess::CPDF_CustomAccess(FPDF_FILEACCESS* pFileAccess) {     i ...

  4. pdfium舍弃v8依赖

    Step 3 去除v8依赖 用文本编辑器打开pdfium根目录下的pdfium.gyp文件,找到'javascript'及'jsapi'依赖(47行左右): 'dependencies': [ 'sa ...

  5. pdfium 之二

    https://www.foxitsoftware.cn/products/premium-pdfium/feature.php 基于谷歌PDFium开源代码 谷歌采用福昕的PDF技术为其PDF开源项 ...

  6. PDFium 渲染

    PDFium 是 Chromium 的 PDF 渲染引擎,许可协议为 BSD 3-Clause.不同于 Mozilla 基于 HTML5 的 PDF.js,PDFium 是基于 Foxit Softw ...

  7. ubuntu pdfium

    dept_tool export PATH=`pwd`/depot_tools:"$PATH" gn工具在内

  8. pdfium 例子

    #include <stdio.h> #include <fpdfview.h> int main(int argc, char** argv) { FPDF_InitLibr ...

  9. pdfium 保存pdf

    // // Created by svenj on 2019/2/3. // extern "C" { #include <unistd.h> #include < ...

随机推荐

  1. pugixml的简单使用

    一.简介 pugixml的官方主页为:http://pugixml.org/ pugixml是一个很棒的XML操作库, 它很轻量,只有三个文件(pugiconfig.hpp   pugixml.cpp ...

  2. c# 第38节 接口的实现

    本节内容: 1:接口的两种实现是什么 2:隐式实现接口的说明 3:为什么有显式 以及显式声明格式 4:实现显式接口 1:接口的两种实现是什么 隐式实现接口:(当继承的父类直接没有相同的方法时) 即可用 ...

  3. 剑指Offer-5.用两个栈实现队列(C++/Java)

    题目: 用两个栈来实现一个队列,完成队列的Push和Pop操作. 队列中的元素为int类型. 分析: 栈的特点是先进后出,队列的特点则是先进先出. 题目要求我们用两个栈来实现一个队列,栈和队列都有入栈 ...

  4. x1

    //程序功能: //要求客户从键盘输入一个整数,判断其是奇是偶 #include <stdio.h> int main(){ int x; printf("输入一个整数:\n&q ...

  5. VMware 自动开多台虚拟机脚本

    d:cd "D:\WinInstall\VMware\VMware Workstation"ECHO "start vm1"vmrun -T ws start ...

  6. 解决Warning: Permanently added ' 192.168.1.230'(RSA) to the list of known hosts.

    前提 当我在刚安装的Red Hat Linux5.x系统中进行ssh 192.168.1.230 远程时,出现以下错误: Warning: Permanently added ' 192.168.1. ...

  7. 关于全局异常(@ControllerAdvice)的学习与思考

    一声梧叶一声秋,一点芭蕉一点愁,三更归梦三更后.____徐再思<水仙子·夜雨> 今天的主题是全局异常的构建,处理,以及一些小细节: 至于全局异常的代码构建以及一些常用的异常处理类可以看这篇 ...

  8. RMI初体验--第一次错处理java.rmi.UnmarshalException&ClassNotFoundException

    今天参考了一下网上Rhello示例,搞了一下RMI测试. server端是 java8 client 段是java6 然后 运行报错: java.rmi.UnmarshalException: err ...

  9. poj-3230 Travel

    One traveler travels among cities. He has to pay for this while he can get some incomes. Now there a ...

  10. Win10+Anaconda+tensorflow-cpu安装教程

    基础概念 Python2.x or Python3.x 自从20世纪90年代初Python语言诞生至今,一直在迭代更新,根据出现的时期,可以分为Python2.x和Python3.x两个大版本.其中P ...