pdf-outlines
v2.0.1
Published
### addOutlines
Downloads
1
Readme
给 PDF 文件添加书签目录
addOutlines
const fs = require("fs");
const { addOutline } = require("../build/index");
const path = require("path");
addOutline({
filePath: path.join(__dirname, "test.pdf"),
outputFilePath: path.join(__dirname, "test-with-outline.pdf"),
outlines: [
{
title: "一、文章标题balabala",
to: 0, // 注意 to 从 0 开始
children: [
{
title: "1.1 文章子标题balabala",
to: 1,
},
{
title: "1.2 文章子标题balabala",
to: 2,
},
],
},
{
title: "二、文章标题balabala",
to: 3,
},
],
});