yom-format 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/dist/cli.d.ts +30 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +344 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +36 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline/avif.d.ts +3 -0
- package/dist/pipeline/avif.d.ts.map +1 -0
- package/dist/pipeline/avif.js +30 -0
- package/dist/pipeline/avif.js.map +1 -0
- package/dist/pipeline/convert.d.ts +28 -0
- package/dist/pipeline/convert.d.ts.map +1 -0
- package/dist/pipeline/convert.js +111 -0
- package/dist/pipeline/convert.js.map +1 -0
- package/dist/pipeline/index.d.ts +17 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +17 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/ocrLayoutBuilder.d.ts +10 -0
- package/dist/pipeline/ocrLayoutBuilder.d.ts.map +1 -0
- package/dist/pipeline/ocrLayoutBuilder.js +62 -0
- package/dist/pipeline/ocrLayoutBuilder.js.map +1 -0
- package/dist/pipeline/pdfDocument.d.ts +12 -0
- package/dist/pipeline/pdfDocument.d.ts.map +1 -0
- package/dist/pipeline/pdfDocument.js +76 -0
- package/dist/pipeline/pdfDocument.js.map +1 -0
- package/dist/pipeline/renderPage.d.ts +10 -0
- package/dist/pipeline/renderPage.d.ts.map +1 -0
- package/dist/pipeline/renderPage.js +36 -0
- package/dist/pipeline/renderPage.js.map +1 -0
- package/dist/pipeline/textExtract.d.ts +29 -0
- package/dist/pipeline/textExtract.d.ts.map +1 -0
- package/dist/pipeline/textExtract.js +48 -0
- package/dist/pipeline/textExtract.js.map +1 -0
- package/dist/yom/blobLimits.d.ts +15 -0
- package/dist/yom/blobLimits.d.ts.map +1 -0
- package/dist/yom/blobLimits.js +25 -0
- package/dist/yom/blobLimits.js.map +1 -0
- package/dist/yom/byteSource.d.ts +56 -0
- package/dist/yom/byteSource.d.ts.map +1 -0
- package/dist/yom/byteSource.js +111 -0
- package/dist/yom/byteSource.js.map +1 -0
- package/dist/yom/bytes.d.ts +2 -0
- package/dist/yom/bytes.d.ts.map +1 -0
- package/dist/yom/bytes.js +13 -0
- package/dist/yom/bytes.js.map +1 -0
- package/dist/yom/constants.d.ts +34 -0
- package/dist/yom/constants.d.ts.map +1 -0
- package/dist/yom/constants.js +82 -0
- package/dist/yom/constants.js.map +1 -0
- package/dist/yom/errors.d.ts +44 -0
- package/dist/yom/errors.d.ts.map +1 -0
- package/dist/yom/errors.js +44 -0
- package/dist/yom/errors.js.map +1 -0
- package/dist/yom/flatbufferVerify.d.ts +21 -0
- package/dist/yom/flatbufferVerify.d.ts.map +1 -0
- package/dist/yom/flatbufferVerify.js +255 -0
- package/dist/yom/flatbufferVerify.js.map +1 -0
- package/dist/yom/generated/yomu/yom/blob-kind.d.ts +9 -0
- package/dist/yom/generated/yomu/yom/blob-kind.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/blob-kind.js +12 -0
- package/dist/yom/generated/yomu/yom/blob-kind.js.map +1 -0
- package/dist/yom/generated/yomu/yom/blob-ref.d.ts +45 -0
- package/dist/yom/generated/yomu/yom/blob-ref.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/blob-ref.js +141 -0
- package/dist/yom/generated/yomu/yom/blob-ref.js.map +1 -0
- package/dist/yom/generated/yomu/yom/book-metadata.d.ts +32 -0
- package/dist/yom/generated/yomu/yom/book-metadata.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/book-metadata.js +89 -0
- package/dist/yom/generated/yomu/yom/book-metadata.js.map +1 -0
- package/dist/yom/generated/yomu/yom/compression.d.ts +5 -0
- package/dist/yom/generated/yomu/yom/compression.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/compression.js +8 -0
- package/dist/yom/generated/yomu/yom/compression.js.map +1 -0
- package/dist/yom/generated/yomu/yom/main-index.d.ts +63 -0
- package/dist/yom/generated/yomu/yom/main-index.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/main-index.js +208 -0
- package/dist/yom/generated/yomu/yom/main-index.js.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrblock.d.ts +32 -0
- package/dist/yom/generated/yomu/yom/ocrblock.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrblock.js +84 -0
- package/dist/yom/generated/yomu/yom/ocrblock.js.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrlayout.d.ts +27 -0
- package/dist/yom/generated/yomu/yom/ocrlayout.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrlayout.js +76 -0
- package/dist/yom/generated/yomu/yom/ocrlayout.js.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrline.d.ts +35 -0
- package/dist/yom/generated/yomu/yom/ocrline.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrline.js +95 -0
- package/dist/yom/generated/yomu/yom/ocrline.js.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrpage.d.ts +46 -0
- package/dist/yom/generated/yomu/yom/ocrpage.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrpage.js +147 -0
- package/dist/yom/generated/yomu/yom/ocrpage.js.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrtoken.d.ts +44 -0
- package/dist/yom/generated/yomu/yom/ocrtoken.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/ocrtoken.js +128 -0
- package/dist/yom/generated/yomu/yom/ocrtoken.js.map +1 -0
- package/dist/yom/generated/yomu/yom/outline-entry.d.ts +31 -0
- package/dist/yom/generated/yomu/yom/outline-entry.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/outline-entry.js +92 -0
- package/dist/yom/generated/yomu/yom/outline-entry.js.map +1 -0
- package/dist/yom/generated/yomu/yom/page-entry.d.ts +95 -0
- package/dist/yom/generated/yomu/yom/page-entry.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/page-entry.js +288 -0
- package/dist/yom/generated/yomu/yom/page-entry.js.map +1 -0
- package/dist/yom/generated/yomu/yom/pdfexport-metadata.d.ts +32 -0
- package/dist/yom/generated/yomu/yom/pdfexport-metadata.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/pdfexport-metadata.js +96 -0
- package/dist/yom/generated/yomu/yom/pdfexport-metadata.js.map +1 -0
- package/dist/yom/generated/yomu/yom/reading-direction.d.ts +5 -0
- package/dist/yom/generated/yomu/yom/reading-direction.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/reading-direction.js +8 -0
- package/dist/yom/generated/yomu/yom/reading-direction.js.map +1 -0
- package/dist/yom/generated/yomu/yom/search-term-ref.d.ts +34 -0
- package/dist/yom/generated/yomu/yom/search-term-ref.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom/search-term-ref.js +99 -0
- package/dist/yom/generated/yomu/yom/search-term-ref.js.map +1 -0
- package/dist/yom/generated/yomu/yom.d.ts +6 -0
- package/dist/yom/generated/yomu/yom.d.ts.map +1 -0
- package/dist/yom/generated/yomu/yom.js +8 -0
- package/dist/yom/generated/yomu/yom.js.map +1 -0
- package/dist/yom/hash.d.ts +4 -0
- package/dist/yom/hash.d.ts.map +1 -0
- package/dist/yom/hash.js +21 -0
- package/dist/yom/hash.js.map +1 -0
- package/dist/yom/header.d.ts +44 -0
- package/dist/yom/header.d.ts.map +1 -0
- package/dist/yom/header.js +115 -0
- package/dist/yom/header.js.map +1 -0
- package/dist/yom/reader.d.ts +57 -0
- package/dist/yom/reader.d.ts.map +1 -0
- package/dist/yom/reader.js +141 -0
- package/dist/yom/reader.js.map +1 -0
- package/dist/yom/searchIndex.d.ts +41 -0
- package/dist/yom/searchIndex.d.ts.map +1 -0
- package/dist/yom/searchIndex.js +133 -0
- package/dist/yom/searchIndex.js.map +1 -0
- package/dist/yom/textNormalizer.d.ts +19 -0
- package/dist/yom/textNormalizer.d.ts.map +1 -0
- package/dist/yom/textNormalizer.js +77 -0
- package/dist/yom/textNormalizer.js.map +1 -0
- package/dist/yom/validator.d.ts +14 -0
- package/dist/yom/validator.d.ts.map +1 -0
- package/dist/yom/validator.js +197 -0
- package/dist/yom/validator.js.map +1 -0
- package/dist/yom/writer.d.ts +76 -0
- package/dist/yom/writer.d.ts.map +1 -0
- package/dist/yom/writer.js +154 -0
- package/dist/yom/writer.js.map +1 -0
- package/dist/yom/zstd.d.ts +14 -0
- package/dist/yom/zstd.d.ts.map +1 -0
- package/dist/yom/zstd.js +43 -0
- package/dist/yom/zstd.js.map +1 -0
- package/package.json +65 -0
- package/src/cli.ts +372 -0
- package/src/index.ts +109 -0
- package/src/pipeline/avif.ts +33 -0
- package/src/pipeline/convert.ts +148 -0
- package/src/pipeline/index.ts +28 -0
- package/src/pipeline/ocrLayoutBuilder.ts +73 -0
- package/src/pipeline/pdfDocument.ts +86 -0
- package/src/pipeline/renderPage.ts +48 -0
- package/src/pipeline/textExtract.ts +64 -0
- package/src/worker/convert.worker.ts +54 -0
- package/src/yom/blobLimits.ts +30 -0
- package/src/yom/byteSource.ts +144 -0
- package/src/yom/bytes.ts +11 -0
- package/src/yom/constants.ts +89 -0
- package/src/yom/errors.ts +43 -0
- package/src/yom/flatbufferVerify.ts +298 -0
- package/src/yom/generated/yomu/yom/blob-kind.ts +12 -0
- package/src/yom/generated/yomu/yom/blob-ref.ts +184 -0
- package/src/yom/generated/yomu/yom/book-metadata.ts +121 -0
- package/src/yom/generated/yomu/yom/compression.ts +8 -0
- package/src/yom/generated/yomu/yom/main-index.ts +257 -0
- package/src/yom/generated/yomu/yom/ocrblock.ts +117 -0
- package/src/yom/generated/yomu/yom/ocrlayout.ts +102 -0
- package/src/yom/generated/yomu/yom/ocrline.ts +131 -0
- package/src/yom/generated/yomu/yom/ocrpage.ts +191 -0
- package/src/yom/generated/yomu/yom/ocrtoken.ts +173 -0
- package/src/yom/generated/yomu/yom/outline-entry.ts +124 -0
- package/src/yom/generated/yomu/yom/page-entry.ts +388 -0
- package/src/yom/generated/yomu/yom/pdfexport-metadata.ts +128 -0
- package/src/yom/generated/yomu/yom/reading-direction.ts +8 -0
- package/src/yom/generated/yomu/yom/search-term-ref.ts +134 -0
- package/src/yom/generated/yomu/yom.ts +9 -0
- package/src/yom/hash.ts +20 -0
- package/src/yom/header.ts +132 -0
- package/src/yom/reader.ts +163 -0
- package/src/yom/searchIndex.ts +178 -0
- package/src/yom/textNormalizer.ts +92 -0
- package/src/yom/validator.ts +245 -0
- package/src/yom/writer.ts +337 -0
- package/src/yom/zstd.ts +47 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
import * as flatbuffers from 'flatbuffers';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export class OutlineEntry implements flatbuffers.IUnpackableObject<OutlineEntryT> {
|
|
10
|
+
bb: flatbuffers.ByteBuffer|null = null;
|
|
11
|
+
bb_pos = 0;
|
|
12
|
+
__init(i:number, bb:flatbuffers.ByteBuffer):OutlineEntry {
|
|
13
|
+
this.bb_pos = i;
|
|
14
|
+
this.bb = bb;
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
static getRootAsOutlineEntry(bb:flatbuffers.ByteBuffer, obj?:OutlineEntry):OutlineEntry {
|
|
19
|
+
return (obj || new OutlineEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
static getSizePrefixedRootAsOutlineEntry(bb:flatbuffers.ByteBuffer, obj?:OutlineEntry):OutlineEntry {
|
|
23
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
24
|
+
return (obj || new OutlineEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
title():string|null
|
|
28
|
+
title(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
29
|
+
title(optionalEncoding?:any):string|Uint8Array|null {
|
|
30
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
31
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
pageId():number {
|
|
35
|
+
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
36
|
+
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
children(index: number, obj?:OutlineEntry):OutlineEntry|null {
|
|
40
|
+
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
41
|
+
return offset ? (obj || new OutlineEntry()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
childrenLength():number {
|
|
45
|
+
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
46
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static startOutlineEntry(builder:flatbuffers.Builder) {
|
|
50
|
+
builder.startObject(3);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static addTitle(builder:flatbuffers.Builder, titleOffset:flatbuffers.Offset) {
|
|
54
|
+
builder.addFieldOffset(0, titleOffset, 0);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static addPageId(builder:flatbuffers.Builder, pageId:number) {
|
|
58
|
+
builder.addFieldInt32(1, pageId, 0);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static addChildren(builder:flatbuffers.Builder, childrenOffset:flatbuffers.Offset) {
|
|
62
|
+
builder.addFieldOffset(2, childrenOffset, 0);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static createChildrenVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
|
66
|
+
builder.startVector(4, data.length, 4);
|
|
67
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
68
|
+
builder.addOffset(data[i]!);
|
|
69
|
+
}
|
|
70
|
+
return builder.endVector();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static startChildrenVector(builder:flatbuffers.Builder, numElems:number) {
|
|
74
|
+
builder.startVector(4, numElems, 4);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static endOutlineEntry(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
78
|
+
const offset = builder.endObject();
|
|
79
|
+
return offset;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static createOutlineEntry(builder:flatbuffers.Builder, titleOffset:flatbuffers.Offset, pageId:number, childrenOffset:flatbuffers.Offset):flatbuffers.Offset {
|
|
83
|
+
OutlineEntry.startOutlineEntry(builder);
|
|
84
|
+
OutlineEntry.addTitle(builder, titleOffset);
|
|
85
|
+
OutlineEntry.addPageId(builder, pageId);
|
|
86
|
+
OutlineEntry.addChildren(builder, childrenOffset);
|
|
87
|
+
return OutlineEntry.endOutlineEntry(builder);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
unpack(): OutlineEntryT {
|
|
91
|
+
return new OutlineEntryT(
|
|
92
|
+
this.title(),
|
|
93
|
+
this.pageId(),
|
|
94
|
+
this.bb!.createObjList<OutlineEntry, OutlineEntryT>(this.children.bind(this), this.childrenLength())
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
unpackTo(_o: OutlineEntryT): void {
|
|
100
|
+
_o.title = this.title();
|
|
101
|
+
_o.pageId = this.pageId();
|
|
102
|
+
_o.children = this.bb!.createObjList<OutlineEntry, OutlineEntryT>(this.children.bind(this), this.childrenLength());
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export class OutlineEntryT implements flatbuffers.IGeneratedObject {
|
|
107
|
+
constructor(
|
|
108
|
+
public title: string|Uint8Array|null = null,
|
|
109
|
+
public pageId: number = 0,
|
|
110
|
+
public children: (OutlineEntryT)[] = []
|
|
111
|
+
){}
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
|
115
|
+
const title = (this.title !== null ? builder.createString(this.title!) : 0);
|
|
116
|
+
const children = OutlineEntry.createChildrenVector(builder, builder.createObjectOffsetList(this.children));
|
|
117
|
+
|
|
118
|
+
return OutlineEntry.createOutlineEntry(builder,
|
|
119
|
+
title,
|
|
120
|
+
this.pageId,
|
|
121
|
+
children
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
import * as flatbuffers from 'flatbuffers';
|
|
6
|
+
|
|
7
|
+
import { ReadingDirection } from '../../yomu/yom/reading-direction.js';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class PageEntry implements flatbuffers.IUnpackableObject<PageEntryT> {
|
|
11
|
+
bb: flatbuffers.ByteBuffer|null = null;
|
|
12
|
+
bb_pos = 0;
|
|
13
|
+
__init(i:number, bb:flatbuffers.ByteBuffer):PageEntry {
|
|
14
|
+
this.bb_pos = i;
|
|
15
|
+
this.bb = bb;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static getRootAsPageEntry(bb:flatbuffers.ByteBuffer, obj?:PageEntry):PageEntry {
|
|
20
|
+
return (obj || new PageEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getSizePrefixedRootAsPageEntry(bb:flatbuffers.ByteBuffer, obj?:PageEntry):PageEntry {
|
|
24
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
25
|
+
return (obj || new PageEntry()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pageId():number {
|
|
29
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
30
|
+
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
pageLabel():string|null
|
|
34
|
+
pageLabel(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
35
|
+
pageLabel(optionalEncoding?:any):string|Uint8Array|null {
|
|
36
|
+
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
37
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
pixelWidth():number {
|
|
41
|
+
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
42
|
+
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
pixelHeight():number {
|
|
46
|
+
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
47
|
+
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
dpi():number {
|
|
51
|
+
const offset = this.bb!.__offset(this.bb_pos, 12);
|
|
52
|
+
return offset ? this.bb!.readFloat32(this.bb_pos + offset) : 0.0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
colorSpace():string|null
|
|
56
|
+
colorSpace(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
57
|
+
colorSpace(optionalEncoding?:any):string|Uint8Array|null {
|
|
58
|
+
const offset = this.bb!.__offset(this.bb_pos, 14);
|
|
59
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
colorProfileRef():string|null
|
|
63
|
+
colorProfileRef(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
64
|
+
colorProfileRef(optionalEncoding?:any):string|Uint8Array|null {
|
|
65
|
+
const offset = this.bb!.__offset(this.bb_pos, 16);
|
|
66
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
mediaBox(index: number):number|null {
|
|
70
|
+
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
71
|
+
return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
mediaBoxLength():number {
|
|
75
|
+
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
76
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
mediaBoxArray():Float32Array|null {
|
|
80
|
+
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
81
|
+
return offset ? new Float32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
cropBox(index: number):number|null {
|
|
85
|
+
const offset = this.bb!.__offset(this.bb_pos, 20);
|
|
86
|
+
return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
cropBoxLength():number {
|
|
90
|
+
const offset = this.bb!.__offset(this.bb_pos, 20);
|
|
91
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
cropBoxArray():Float32Array|null {
|
|
95
|
+
const offset = this.bb!.__offset(this.bb_pos, 20);
|
|
96
|
+
return offset ? new Float32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
contentBox(index: number):number|null {
|
|
100
|
+
const offset = this.bb!.__offset(this.bb_pos, 22);
|
|
101
|
+
return offset ? this.bb!.readFloat32(this.bb!.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
contentBoxLength():number {
|
|
105
|
+
const offset = this.bb!.__offset(this.bb_pos, 22);
|
|
106
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
contentBoxArray():Float32Array|null {
|
|
110
|
+
const offset = this.bb!.__offset(this.bb_pos, 22);
|
|
111
|
+
return offset ? new Float32Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
rotation():number {
|
|
115
|
+
const offset = this.bb!.__offset(this.bb_pos, 24);
|
|
116
|
+
return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
readingDirection():ReadingDirection {
|
|
120
|
+
const offset = this.bb!.__offset(this.bb_pos, 26);
|
|
121
|
+
return offset ? this.bb!.readUint8(this.bb_pos + offset) : ReadingDirection.LeftToRight;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
pageImageBlobIndex():number {
|
|
125
|
+
const offset = this.bb!.__offset(this.bb_pos, 28);
|
|
126
|
+
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
thumbnailBlobIndex():number {
|
|
130
|
+
const offset = this.bb!.__offset(this.bb_pos, 30);
|
|
131
|
+
return offset ? this.bb!.readUint32(this.bb_pos + offset) : 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
imageHash(index: number):number|null {
|
|
135
|
+
const offset = this.bb!.__offset(this.bb_pos, 32);
|
|
136
|
+
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
imageHashLength():number {
|
|
140
|
+
const offset = this.bb!.__offset(this.bb_pos, 32);
|
|
141
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
imageHashArray():Uint8Array|null {
|
|
145
|
+
const offset = this.bb!.__offset(this.bb_pos, 32);
|
|
146
|
+
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
static startPageEntry(builder:flatbuffers.Builder) {
|
|
150
|
+
builder.startObject(15);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
static addPageId(builder:flatbuffers.Builder, pageId:number) {
|
|
154
|
+
builder.addFieldInt32(0, pageId, 0);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
static addPageLabel(builder:flatbuffers.Builder, pageLabelOffset:flatbuffers.Offset) {
|
|
158
|
+
builder.addFieldOffset(1, pageLabelOffset, 0);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
static addPixelWidth(builder:flatbuffers.Builder, pixelWidth:number) {
|
|
162
|
+
builder.addFieldInt32(2, pixelWidth, 0);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
static addPixelHeight(builder:flatbuffers.Builder, pixelHeight:number) {
|
|
166
|
+
builder.addFieldInt32(3, pixelHeight, 0);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
static addDpi(builder:flatbuffers.Builder, dpi:number) {
|
|
170
|
+
builder.addFieldFloat32(4, dpi, 0.0);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static addColorSpace(builder:flatbuffers.Builder, colorSpaceOffset:flatbuffers.Offset) {
|
|
174
|
+
builder.addFieldOffset(5, colorSpaceOffset, 0);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
static addColorProfileRef(builder:flatbuffers.Builder, colorProfileRefOffset:flatbuffers.Offset) {
|
|
178
|
+
builder.addFieldOffset(6, colorProfileRefOffset, 0);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
static addMediaBox(builder:flatbuffers.Builder, mediaBoxOffset:flatbuffers.Offset) {
|
|
182
|
+
builder.addFieldOffset(7, mediaBoxOffset, 0);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
static createMediaBoxVector(builder:flatbuffers.Builder, data:number[]|Float32Array):flatbuffers.Offset;
|
|
186
|
+
/**
|
|
187
|
+
* @deprecated This Uint8Array overload will be removed in the future.
|
|
188
|
+
*/
|
|
189
|
+
static createMediaBoxVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
|
|
190
|
+
static createMediaBoxVector(builder:flatbuffers.Builder, data:number[]|Float32Array|Uint8Array):flatbuffers.Offset {
|
|
191
|
+
builder.startVector(4, data.length, 4);
|
|
192
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
193
|
+
builder.addFloat32(data[i]!);
|
|
194
|
+
}
|
|
195
|
+
return builder.endVector();
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
static startMediaBoxVector(builder:flatbuffers.Builder, numElems:number) {
|
|
199
|
+
builder.startVector(4, numElems, 4);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
static addCropBox(builder:flatbuffers.Builder, cropBoxOffset:flatbuffers.Offset) {
|
|
203
|
+
builder.addFieldOffset(8, cropBoxOffset, 0);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static createCropBoxVector(builder:flatbuffers.Builder, data:number[]|Float32Array):flatbuffers.Offset;
|
|
207
|
+
/**
|
|
208
|
+
* @deprecated This Uint8Array overload will be removed in the future.
|
|
209
|
+
*/
|
|
210
|
+
static createCropBoxVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
|
|
211
|
+
static createCropBoxVector(builder:flatbuffers.Builder, data:number[]|Float32Array|Uint8Array):flatbuffers.Offset {
|
|
212
|
+
builder.startVector(4, data.length, 4);
|
|
213
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
214
|
+
builder.addFloat32(data[i]!);
|
|
215
|
+
}
|
|
216
|
+
return builder.endVector();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static startCropBoxVector(builder:flatbuffers.Builder, numElems:number) {
|
|
220
|
+
builder.startVector(4, numElems, 4);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static addContentBox(builder:flatbuffers.Builder, contentBoxOffset:flatbuffers.Offset) {
|
|
224
|
+
builder.addFieldOffset(9, contentBoxOffset, 0);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static createContentBoxVector(builder:flatbuffers.Builder, data:number[]|Float32Array):flatbuffers.Offset;
|
|
228
|
+
/**
|
|
229
|
+
* @deprecated This Uint8Array overload will be removed in the future.
|
|
230
|
+
*/
|
|
231
|
+
static createContentBoxVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset;
|
|
232
|
+
static createContentBoxVector(builder:flatbuffers.Builder, data:number[]|Float32Array|Uint8Array):flatbuffers.Offset {
|
|
233
|
+
builder.startVector(4, data.length, 4);
|
|
234
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
235
|
+
builder.addFloat32(data[i]!);
|
|
236
|
+
}
|
|
237
|
+
return builder.endVector();
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
static startContentBoxVector(builder:flatbuffers.Builder, numElems:number) {
|
|
241
|
+
builder.startVector(4, numElems, 4);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
static addRotation(builder:flatbuffers.Builder, rotation:number) {
|
|
245
|
+
builder.addFieldInt32(10, rotation, 0);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
static addReadingDirection(builder:flatbuffers.Builder, readingDirection:ReadingDirection) {
|
|
249
|
+
builder.addFieldInt8(11, readingDirection, ReadingDirection.LeftToRight);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
static addPageImageBlobIndex(builder:flatbuffers.Builder, pageImageBlobIndex:number) {
|
|
253
|
+
builder.addFieldInt32(12, pageImageBlobIndex, 0);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
static addThumbnailBlobIndex(builder:flatbuffers.Builder, thumbnailBlobIndex:number) {
|
|
257
|
+
builder.addFieldInt32(13, thumbnailBlobIndex, 0);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
static addImageHash(builder:flatbuffers.Builder, imageHashOffset:flatbuffers.Offset) {
|
|
261
|
+
builder.addFieldOffset(14, imageHashOffset, 0);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
static createImageHashVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
|
|
265
|
+
builder.startVector(1, data.length, 1);
|
|
266
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
267
|
+
builder.addInt8(data[i]!);
|
|
268
|
+
}
|
|
269
|
+
return builder.endVector();
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
static startImageHashVector(builder:flatbuffers.Builder, numElems:number) {
|
|
273
|
+
builder.startVector(1, numElems, 1);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
static endPageEntry(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
277
|
+
const offset = builder.endObject();
|
|
278
|
+
return offset;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
static createPageEntry(builder:flatbuffers.Builder, pageId:number, pageLabelOffset:flatbuffers.Offset, pixelWidth:number, pixelHeight:number, dpi:number, colorSpaceOffset:flatbuffers.Offset, colorProfileRefOffset:flatbuffers.Offset, mediaBoxOffset:flatbuffers.Offset, cropBoxOffset:flatbuffers.Offset, contentBoxOffset:flatbuffers.Offset, rotation:number, readingDirection:ReadingDirection, pageImageBlobIndex:number, thumbnailBlobIndex:number, imageHashOffset:flatbuffers.Offset):flatbuffers.Offset {
|
|
282
|
+
PageEntry.startPageEntry(builder);
|
|
283
|
+
PageEntry.addPageId(builder, pageId);
|
|
284
|
+
PageEntry.addPageLabel(builder, pageLabelOffset);
|
|
285
|
+
PageEntry.addPixelWidth(builder, pixelWidth);
|
|
286
|
+
PageEntry.addPixelHeight(builder, pixelHeight);
|
|
287
|
+
PageEntry.addDpi(builder, dpi);
|
|
288
|
+
PageEntry.addColorSpace(builder, colorSpaceOffset);
|
|
289
|
+
PageEntry.addColorProfileRef(builder, colorProfileRefOffset);
|
|
290
|
+
PageEntry.addMediaBox(builder, mediaBoxOffset);
|
|
291
|
+
PageEntry.addCropBox(builder, cropBoxOffset);
|
|
292
|
+
PageEntry.addContentBox(builder, contentBoxOffset);
|
|
293
|
+
PageEntry.addRotation(builder, rotation);
|
|
294
|
+
PageEntry.addReadingDirection(builder, readingDirection);
|
|
295
|
+
PageEntry.addPageImageBlobIndex(builder, pageImageBlobIndex);
|
|
296
|
+
PageEntry.addThumbnailBlobIndex(builder, thumbnailBlobIndex);
|
|
297
|
+
PageEntry.addImageHash(builder, imageHashOffset);
|
|
298
|
+
return PageEntry.endPageEntry(builder);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
unpack(): PageEntryT {
|
|
302
|
+
return new PageEntryT(
|
|
303
|
+
this.pageId(),
|
|
304
|
+
this.pageLabel(),
|
|
305
|
+
this.pixelWidth(),
|
|
306
|
+
this.pixelHeight(),
|
|
307
|
+
this.dpi(),
|
|
308
|
+
this.colorSpace(),
|
|
309
|
+
this.colorProfileRef(),
|
|
310
|
+
this.bb!.createScalarList<number>(this.mediaBox.bind(this), this.mediaBoxLength()),
|
|
311
|
+
this.bb!.createScalarList<number>(this.cropBox.bind(this), this.cropBoxLength()),
|
|
312
|
+
this.bb!.createScalarList<number>(this.contentBox.bind(this), this.contentBoxLength()),
|
|
313
|
+
this.rotation(),
|
|
314
|
+
this.readingDirection(),
|
|
315
|
+
this.pageImageBlobIndex(),
|
|
316
|
+
this.thumbnailBlobIndex(),
|
|
317
|
+
this.bb!.createScalarList<number>(this.imageHash.bind(this), this.imageHashLength())
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
unpackTo(_o: PageEntryT): void {
|
|
323
|
+
_o.pageId = this.pageId();
|
|
324
|
+
_o.pageLabel = this.pageLabel();
|
|
325
|
+
_o.pixelWidth = this.pixelWidth();
|
|
326
|
+
_o.pixelHeight = this.pixelHeight();
|
|
327
|
+
_o.dpi = this.dpi();
|
|
328
|
+
_o.colorSpace = this.colorSpace();
|
|
329
|
+
_o.colorProfileRef = this.colorProfileRef();
|
|
330
|
+
_o.mediaBox = this.bb!.createScalarList<number>(this.mediaBox.bind(this), this.mediaBoxLength());
|
|
331
|
+
_o.cropBox = this.bb!.createScalarList<number>(this.cropBox.bind(this), this.cropBoxLength());
|
|
332
|
+
_o.contentBox = this.bb!.createScalarList<number>(this.contentBox.bind(this), this.contentBoxLength());
|
|
333
|
+
_o.rotation = this.rotation();
|
|
334
|
+
_o.readingDirection = this.readingDirection();
|
|
335
|
+
_o.pageImageBlobIndex = this.pageImageBlobIndex();
|
|
336
|
+
_o.thumbnailBlobIndex = this.thumbnailBlobIndex();
|
|
337
|
+
_o.imageHash = this.bb!.createScalarList<number>(this.imageHash.bind(this), this.imageHashLength());
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
export class PageEntryT implements flatbuffers.IGeneratedObject {
|
|
342
|
+
constructor(
|
|
343
|
+
public pageId: number = 0,
|
|
344
|
+
public pageLabel: string|Uint8Array|null = null,
|
|
345
|
+
public pixelWidth: number = 0,
|
|
346
|
+
public pixelHeight: number = 0,
|
|
347
|
+
public dpi: number = 0.0,
|
|
348
|
+
public colorSpace: string|Uint8Array|null = null,
|
|
349
|
+
public colorProfileRef: string|Uint8Array|null = null,
|
|
350
|
+
public mediaBox: (number)[] = [],
|
|
351
|
+
public cropBox: (number)[] = [],
|
|
352
|
+
public contentBox: (number)[] = [],
|
|
353
|
+
public rotation: number = 0,
|
|
354
|
+
public readingDirection: ReadingDirection = ReadingDirection.LeftToRight,
|
|
355
|
+
public pageImageBlobIndex: number = 0,
|
|
356
|
+
public thumbnailBlobIndex: number = 0,
|
|
357
|
+
public imageHash: (number)[] = []
|
|
358
|
+
){}
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
|
362
|
+
const pageLabel = (this.pageLabel !== null ? builder.createString(this.pageLabel!) : 0);
|
|
363
|
+
const colorSpace = (this.colorSpace !== null ? builder.createString(this.colorSpace!) : 0);
|
|
364
|
+
const colorProfileRef = (this.colorProfileRef !== null ? builder.createString(this.colorProfileRef!) : 0);
|
|
365
|
+
const mediaBox = PageEntry.createMediaBoxVector(builder, this.mediaBox);
|
|
366
|
+
const cropBox = PageEntry.createCropBoxVector(builder, this.cropBox);
|
|
367
|
+
const contentBox = PageEntry.createContentBoxVector(builder, this.contentBox);
|
|
368
|
+
const imageHash = PageEntry.createImageHashVector(builder, this.imageHash);
|
|
369
|
+
|
|
370
|
+
return PageEntry.createPageEntry(builder,
|
|
371
|
+
this.pageId,
|
|
372
|
+
pageLabel,
|
|
373
|
+
this.pixelWidth,
|
|
374
|
+
this.pixelHeight,
|
|
375
|
+
this.dpi,
|
|
376
|
+
colorSpace,
|
|
377
|
+
colorProfileRef,
|
|
378
|
+
mediaBox,
|
|
379
|
+
cropBox,
|
|
380
|
+
contentBox,
|
|
381
|
+
this.rotation,
|
|
382
|
+
this.readingDirection,
|
|
383
|
+
this.pageImageBlobIndex,
|
|
384
|
+
this.thumbnailBlobIndex,
|
|
385
|
+
imageHash
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
import * as flatbuffers from 'flatbuffers';
|
|
6
|
+
|
|
7
|
+
import { OutlineEntry, OutlineEntryT } from '../../yomu/yom/outline-entry.js';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
export class PDFExportMetadata implements flatbuffers.IUnpackableObject<PDFExportMetadataT> {
|
|
11
|
+
bb: flatbuffers.ByteBuffer|null = null;
|
|
12
|
+
bb_pos = 0;
|
|
13
|
+
__init(i:number, bb:flatbuffers.ByteBuffer):PDFExportMetadata {
|
|
14
|
+
this.bb_pos = i;
|
|
15
|
+
this.bb = bb;
|
|
16
|
+
return this;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static getRootAsPDFExportMetadata(bb:flatbuffers.ByteBuffer, obj?:PDFExportMetadata):PDFExportMetadata {
|
|
20
|
+
return (obj || new PDFExportMetadata()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getSizePrefixedRootAsPDFExportMetadata(bb:flatbuffers.ByteBuffer, obj?:PDFExportMetadata):PDFExportMetadata {
|
|
24
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
25
|
+
return (obj || new PDFExportMetadata()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
pageLabels(index: number):string
|
|
29
|
+
pageLabels(index: number,optionalEncoding:flatbuffers.Encoding):string|Uint8Array
|
|
30
|
+
pageLabels(index: number,optionalEncoding?:any):string|Uint8Array|null {
|
|
31
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
32
|
+
return offset ? this.bb!.__string(this.bb!.__vector(this.bb_pos + offset) + index * 4, optionalEncoding) : null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
pageLabelsLength():number {
|
|
36
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
37
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
outline(index: number, obj?:OutlineEntry):OutlineEntry|null {
|
|
41
|
+
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
42
|
+
return offset ? (obj || new OutlineEntry()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
outlineLength():number {
|
|
46
|
+
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
47
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
static startPDFExportMetadata(builder:flatbuffers.Builder) {
|
|
51
|
+
builder.startObject(2);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static addPageLabels(builder:flatbuffers.Builder, pageLabelsOffset:flatbuffers.Offset) {
|
|
55
|
+
builder.addFieldOffset(0, pageLabelsOffset, 0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
static createPageLabelsVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
|
59
|
+
builder.startVector(4, data.length, 4);
|
|
60
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
61
|
+
builder.addOffset(data[i]!);
|
|
62
|
+
}
|
|
63
|
+
return builder.endVector();
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static startPageLabelsVector(builder:flatbuffers.Builder, numElems:number) {
|
|
67
|
+
builder.startVector(4, numElems, 4);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static addOutline(builder:flatbuffers.Builder, outlineOffset:flatbuffers.Offset) {
|
|
71
|
+
builder.addFieldOffset(1, outlineOffset, 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static createOutlineVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
|
75
|
+
builder.startVector(4, data.length, 4);
|
|
76
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
77
|
+
builder.addOffset(data[i]!);
|
|
78
|
+
}
|
|
79
|
+
return builder.endVector();
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static startOutlineVector(builder:flatbuffers.Builder, numElems:number) {
|
|
83
|
+
builder.startVector(4, numElems, 4);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
static endPDFExportMetadata(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
87
|
+
const offset = builder.endObject();
|
|
88
|
+
return offset;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static createPDFExportMetadata(builder:flatbuffers.Builder, pageLabelsOffset:flatbuffers.Offset, outlineOffset:flatbuffers.Offset):flatbuffers.Offset {
|
|
92
|
+
PDFExportMetadata.startPDFExportMetadata(builder);
|
|
93
|
+
PDFExportMetadata.addPageLabels(builder, pageLabelsOffset);
|
|
94
|
+
PDFExportMetadata.addOutline(builder, outlineOffset);
|
|
95
|
+
return PDFExportMetadata.endPDFExportMetadata(builder);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
unpack(): PDFExportMetadataT {
|
|
99
|
+
return new PDFExportMetadataT(
|
|
100
|
+
this.bb!.createScalarList<string>(this.pageLabels.bind(this), this.pageLabelsLength()),
|
|
101
|
+
this.bb!.createObjList<OutlineEntry, OutlineEntryT>(this.outline.bind(this), this.outlineLength())
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
unpackTo(_o: PDFExportMetadataT): void {
|
|
107
|
+
_o.pageLabels = this.bb!.createScalarList<string>(this.pageLabels.bind(this), this.pageLabelsLength());
|
|
108
|
+
_o.outline = this.bb!.createObjList<OutlineEntry, OutlineEntryT>(this.outline.bind(this), this.outlineLength());
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export class PDFExportMetadataT implements flatbuffers.IGeneratedObject {
|
|
113
|
+
constructor(
|
|
114
|
+
public pageLabels: (string)[] = [],
|
|
115
|
+
public outline: (OutlineEntryT)[] = []
|
|
116
|
+
){}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
|
120
|
+
const pageLabels = PDFExportMetadata.createPageLabelsVector(builder, builder.createObjectOffsetList(this.pageLabels));
|
|
121
|
+
const outline = PDFExportMetadata.createOutlineVector(builder, builder.createObjectOffsetList(this.outline));
|
|
122
|
+
|
|
123
|
+
return PDFExportMetadata.createPDFExportMetadata(builder,
|
|
124
|
+
pageLabels,
|
|
125
|
+
outline
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
export enum ReadingDirection {
|
|
6
|
+
LeftToRight = 0,
|
|
7
|
+
RightToLeft = 1
|
|
8
|
+
}
|