mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
[edition] Add support for saving a newly added FreeText
This commit is contained in:
parent
1816b5e926
commit
7773b3f5be
12 changed files with 409 additions and 23 deletions
|
@ -20,6 +20,16 @@ import { SimpleDOMNode, SimpleXMLParser } from "./xml_parser.js";
|
|||
import { BaseStream } from "./base_stream.js";
|
||||
import { calculateMD5 } from "./crypto.js";
|
||||
|
||||
function writeObject(ref, obj, buffer, transform) {
|
||||
buffer.push(`${ref.num} ${ref.gen} obj\n`);
|
||||
if (obj instanceof Dict) {
|
||||
writeDict(obj, buffer, transform);
|
||||
} else if (obj instanceof BaseStream) {
|
||||
writeStream(obj, buffer, transform);
|
||||
}
|
||||
buffer.push("\nendobj\n");
|
||||
}
|
||||
|
||||
function writeDict(dict, buffer, transform) {
|
||||
buffer.push("<<");
|
||||
for (const key of dict.getKeys()) {
|
||||
|
@ -328,4 +338,4 @@ function incrementalUpdate({
|
|||
return array;
|
||||
}
|
||||
|
||||
export { incrementalUpdate, writeDict };
|
||||
export { incrementalUpdate, writeDict, writeObject };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue