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 < ...
随机推荐
- NOI2015 软件包管器
NOI2015 软件包管器 https://www.luogu.org/problem/P2146 题意 维护一棵树,每个节点都有一个为0或1的值,初始值全为0 需要支持 将一条链上的点都变成1, 将 ...
- Apache(基于主机名)
1.配置hosts文件 (1).hosts文件作用是定义IP地址与主机名的映射关系,即强制将某个主机名地址解析到指定的IP地址. (2)输入命令“vi /etc/hosts”,打开hosts文件,输入 ...
- Codeforces Round #606 (Div. 2, based on Technocup 2020 Elimination Round 4)
链接 签到题,求出位数,然后9*(位数-1)+ 从位数相同的全一开始加看能加几次的个数 #include<bits/stdc++.h> using namespace std; int m ...
- OC方法交换swizzle详细介绍——不再有盲点
原文链接:https://www.cnblogs.com/mddblog/p/11105450.html 如果对方法交换已经比较熟悉,可以跳过整体介绍,直接看常见问题部分 整体介绍 方法交换是runt ...
- ShiroUtil 对密码进行加密
ShiroUtil 对密码进行加密 package com.mozq.sb.shiro02.config; import org.apache.shiro.authc.SimpleAuthentica ...
- 使用Vue Baidu Map对百度地图实现输入框搜索定位
前端时间需要在页面的输入框输入地址,搜索并在百度地图上获取选定结果的坐标,前端使用了Vue + Element-ui,地图方面直接使用了封装好的百度地图vue组件-vue-baidu-map ...
- .net core session部分浏览器或移动客户端不可用
.net core session使用有很多文章,这里不再赘述. 问题现象为大部分浏览器或者移动客户端(例如微信.支付宝.钉钉)等都可以正常使用.但部分支付宝用户及钉钉用户确无法使用. 写入后读取不到 ...
- Python基础-day02-3
循环 目标 程序的三大流程 while 循环基本使用 break 和 continue while 循环嵌套 01. 程序的三大流程 在程序开发中,一共有三种流程方式: 顺序 -- 从上向下,顺序执行 ...
- sed命令常用用法
1.字符串替换 sed -i "s/xxx/yyy/g" /home/test.log // 将home目录下的test.txt文件中的所有xxx字符串替换成yyy字符串 sed ...
- ItelliJ Idea 2019提交TFVC变更,系统提示Validation must be performed before checking in
问题描述 全新安装的Idea 2019,从Azure DevOps Server 2019 (原名TFS)的TFVC代码库下载文件,正常. 修改代码后,签入,系统提示"Validation ...