IncrementalUpdate
IncrementalUpdate
概述
IncrementalUpdate 是 Aspose.PDF FOSS 中用于 Python 的一个类。
为现有 PDF 生成增量更新部分。
此类提供 8 个方法,用于在 Python 程序中处理 IncrementalUpdate 对象。可用的方法包括:add_new_object、add_object、build_incremental_trailer、build_incremental_xref、find_last_eof、find_startxref、generate、get_next_object_number。在安装了 Aspose.PDF FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:budget、limits、modified_objects、next_obj_num、original_data、original_eof_offset,以及其他 1 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
original_data | bytes | 读写 | 获取或设置原始数据。 |
limits | `PdfLoadLimits | None` | 读写 |
budget | `_LoadBudget | None` | 读写 |
original_eof_offset | int | 读写 | 获取或设置原始 eof 偏移。 |
next_obj_num | int | 读写 | 获取或设置下一个对象编号。 |
modified_objects | dict[int, bytes] | 读写 | 获取或设置已修改的对象。 |
xref_entries | list[tuple[int, int, int]] | 读写 | 获取或设置 xref 条目。 |
方法
| 签名 | 描述 |
|---|---|
find_last_eof() → int | 返回最后一个 %%EOF 标记的起始索引。 |
find_startxref() → int | 返回最后一个 startxref 关键字之后的整数值。 |
get_next_object_number() → int | 返回并保留下一个可用的对象编号。 |
add_object(obj_num: int, obj_bytes: bytes) | 在增量更新中添加或替换对象。 |
add_new_object(obj_bytes: bytes) → int | 添加一个全新的对象并返回其分配的编号。 |
build_incremental_xref(base_offset: int) → bytes | 为追加的对象创建 xref 节。 |
build_incremental_trailer(prev_xref: int, new_size: int, xref_offset: int) → bytes | 创建一个引用先前 xref 表的 trailer。 |
generate() → bytes | 返回完整的增量更新字节。 |