lopdf-0.32.0/.cargo_vcs_info.json 0000644 00000000136 00000000001 0012222 0 ustar {
"git": {
"sha1": "aaa343efeee5cf63808ee20f7635f18a2b71087a"
},
"path_in_vcs": ""
} lopdf-0.32.0/.chglog/CHANGELOG.tpl.md 0000644 0000000 0000000 00000000757 00726746425 0015003 0 ustar 0000000 0000000 {{ range .Versions }}
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }})
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
* {{ .Subject }}
{{ end }}
{{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}} lopdf-0.32.0/.chglog/config.yml 0000644 0000000 0000000 00000001016 00726746425 0014351 0 ustar 0000000 0000000 style: github
template: CHANGELOG.tpl.md
info:
title: CHANGELOG
repository_url: https://github.com/J-F-Liu/lopdf
options:
commits:
# filters:
# Type:
# - feat
# - fix
# - perf
# - refactor
commit_groups:
# title_maps:
# feat: Features
# fix: Bug Fixes
# perf: Performance Improvements
# refactor: Code Refactoring
header:
pattern: "^((\\w+)\\s.*)$"
pattern_maps:
- Subject
- Type
notes:
keywords:
- BREAKING CHANGE lopdf-0.32.0/.editorconfig 0000644 0000000 0000000 00000000302 00726746425 0013512 0 ustar 0000000 0000000 root = true
[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
[*.{md,pdf}]
trim_trailing_whitespace = false
lopdf-0.32.0/.gitattributes 0000644 0000000 0000000 00000000157 00726746425 0013740 0 ustar 0000000 0000000 * text eol=lf
*.rs text diff=rust
*.toml text diff=toml
*.pdf binary
Cargo.lock text
lopdf-0.32.0/.github/workflows/ci.yml 0000644 0000000 0000000 00000003505 00726746425 0015560 0 ustar 0000000 0000000 name: CI
on:
push:
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.continue-on-error || false }}
strategy:
matrix:
name:
- stable
- beta
- nightly
- "feat: no default features"
- "feat: all features"
- "feat: nom only"
include:
- name: beta
rust: beta
- name: nightly
rust: nightly
continue-on-error: true
- name: "feat: all features"
features: "--all-features"
- name: "feat: nom only"
features: "--no-default-features --features nom_parser"
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust || 'stable' }}
- name: Build
run: cargo build --verbose ${{ matrix.features }}
- name: Run tests
run: cargo test --verbose ${{ matrix.features }} -- --test-threads=1
pdfutil:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- name: Build
run: cargo build --verbose --manifest-path pdfutil/Cargo.toml
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: hecrj/setup-rust-action@v1
- name: clippy for lopdf
run: cargo clippy
- name: clippy for pdfutil
run: cargo clippy --manifest-path pdfutil/Cargo.toml
lopdf-0.32.0/.gitignore 0000644 0000000 0000000 00000000047 00726746425 0013033 0 ustar 0000000 0000000 target
Cargo.lock
test*.pdf
.idea
*.pdf lopdf-0.32.0/.travis.yml 0000644 0000000 0000000 00000001026 00726746425 0013152 0 ustar 0000000 0000000 language: rust
cache: cargo
rust:
- stable
- beta
- nightly
script:
- cargo clean
- cargo +nightly fmt -- --check
- cargo check --verbose --no-default-features
- cargo check --verbose --features="chrono_time"
- cargo check --verbose --features="nom_parser"
- cargo test --verbose
- cargo test --verbose --features="nom_parser"
- cargo test --verbose --examples
- cargo clippy -- -D warnings
- cargo clippy -- -D warnings --features="nom_parser"
matrix:
allow_failures:
- rust: nightly
sudo: false
lopdf-0.32.0/.vscode/launch.json 0000644 0000000 0000000 00000000760 00726746425 0014553 0 ustar 0000000 0000000 {
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "lldb",
"program": "./pdfutil/target/debug/pdfutil",
"args": ["decompress", "-i", "/Users/Junfeng/Downloads/Lifetimes.pdf"],
"cwd": "${workspaceRoot}"
},
{
"type": "lldb-mi",
"request": "launch",
"name": "pdfutil",
"target": "./pdfutil/target/debug/pdfutil",
"arguments": "decompress -i /Users/Junfeng/Downloads/Lifetimes.pdf",
"cwd": "${workspaceRoot}"
}
]
}
lopdf-0.32.0/.vscode/settings.json 0000644 0000000 0000000 00000000177 00726746425 0015143 0 ustar 0000000 0000000 {
"editor.formatOnSave": true,
"[markdown]": {
"editor.formatOnSave": false
},
"search.exclude": {
"target": true
}
}
lopdf-0.32.0/CHANGELOG.md 0000644 0000000 0000000 00000036204 00726746425 0012660 0 ustar 0000000 0000000
* Added new field to `Document`, `xref_start`. Default value is `0`.
* Added new function to `Document`: `new_from_prev`, `has_object`, `add_page_contents`, `set_object`
* New structure added `IncrementalDocument`.
* Support writing of PDF file with "Cross Reference Stream".
* Cross Reference Tables now write abbreviated tables when non-consecutive object are written.
## [v0.26.0](https://github.com/J-F-Liu/lopdf/compare/v0.25.0...v0.26.0) (2020-09-29)
### Add
* Add `as_str`, `as_str_mut` methods to `Object` ([#107](https://github.com/J-F-Liu/lopdf/issues/107))
### Dtoa
* dtoa may write real number in exponential format which is not allowed in PDF
### Genericize
* Genericize Content to allow `AsRef<[Operation]>` ([#111](https://github.com/J-F-Liu/lopdf/issues/111))
### Make
* Make pom dependency optional (but default) ([#112](https://github.com/J-F-Liu/lopdf/issues/112))
* Make rayon dependency optional ([#108](https://github.com/J-F-Liu/lopdf/issues/108))
### Merge
* Merge document PDF logic with some fixes ([#117](https://github.com/J-F-Liu/lopdf/issues/117))
### Various
* Various improvements, updated libraries and image features ([#118](https://github.com/J-F-Liu/lopdf/issues/118))
## [v0.25.0](https://github.com/J-F-Liu/lopdf/compare/v0.24.0...v0.25.0) (2020-06-25)
### Add
* Add indexing checks ([#98](https://github.com/J-F-Liu/lopdf/issues/98))
### Add
* Add a test for [#93](https://github.com/J-F-Liu/lopdf/issues/93) ([#95](https://github.com/J-F-Liu/lopdf/issues/95))
### Bugfix
* Bugfix for xref_start. ([#105](https://github.com/J-F-Liu/lopdf/issues/105))
### Check
* check that the buffer is big enough for startxref ([#93](https://github.com/J-F-Liu/lopdf/issues/93))
### Create
* Create rust.yml ([#104](https://github.com/J-F-Liu/lopdf/issues/104))
### Extend
* extend recursion limit to non-local references ([#100](https://github.com/J-F-Liu/lopdf/issues/100))
### Fix
* Fix compilation error&test error ([#102](https://github.com/J-F-Liu/lopdf/issues/102))
### Keep
* keep looking for the last pattern ([#94](https://github.com/J-F-Liu/lopdf/issues/94))
### Limit
* limit recursion to the number of objects ([#92](https://github.com/J-F-Liu/lopdf/issues/92))
### Limit
* Limit allowed bracket depth. ([#97](https://github.com/J-F-Liu/lopdf/issues/97))
### Move
* Move bracket depth checking into parsers. ([#101](https://github.com/J-F-Liu/lopdf/issues/101))
### Release
* Release 0.25
### Return
* Return Result from as_array_mut() ([#106](https://github.com/J-F-Liu/lopdf/issues/106))
### Update
* Update itoa and linked-hash-map ([#91](https://github.com/J-F-Liu/lopdf/issues/91))
## [v0.24.0](https://github.com/J-F-Liu/lopdf/compare/v0.23.0...v0.24.0) (2020-02-17)
### Compute
* Compute an accurate iterator size when the page tree is sane.
### Fix
* Fix datetime parser ([#89](https://github.com/J-F-Liu/lopdf/issues/89))
### More
* More permissive datetime parsing ([#90](https://github.com/J-F-Liu/lopdf/issues/90))
### Release
* Release 0.24
### Validate
* Validate expected id in pom parser.
* Validate the expected id when reading indirect objects.
## [v0.23.0](https://github.com/J-F-Liu/lopdf/compare/v0.22.0...v0.23.0) (2019-07-14)
### Adapt
* Adapt pom parser.
### Add
* Add error descriptions.
* Add a proper error type and remove some more panics.
### Allow
* Allow loading a document from a memory slice.
### Avoid
* Avoid allocating an intermediate collection for iteration.
* Avoid unwraps when already returning an Option for failure.
### Error
* Error signaling around compression and image handling.
### Escape
* Escape fix ([#68](https://github.com/J-F-Liu/lopdf/issues/68))
### Export
* Export dereference function as it is useful for PDF consumers.
* Export filters module.
### Get_font_encoding
* get_font_encoding seems more at home with Dictionary.
### Handle
* Handle stream filter chains ([#66](https://github.com/J-F-Liu/lopdf/issues/66))
### Hex
* Hex fix ([#67](https://github.com/J-F-Liu/lopdf/issues/67))
### Implement
* Implement LZW decompression.
### Improve
* Improve hex parsing performance.
### Make
* Make a page iterator.
* Make Reader::read consume the Reader.
* Make content operations faillible.
### Protect
* Protect against reference loops.
* Protect against a corrupted page tree.
### Refactor
* Refactor a bit to allow a utility function.
### Release
* Release 0.23.0
### Remove
* Remove intermediate assignation.
* Remove unsafe code around FilterType.
* Remove unsafe code on get_object_mut.
* Remove some 'if let' for readability.
* Remove more panic paths in xref parsing.
### Replace
* Replace unwraps in processor.rs.
### Return
* Return results when appropriate.
### Separate
* Separate decompression into two functions.
### Take
* Take care of panic that I actually hit on the pom side.
* Take care of creator.rs.
### Unify
* Unify buffer creation.
### Use
* Use lifetime ellision.
* Use TryInto.
* Use writeln where appropriate.
* Use error enum in reader.
* Use stable cloned.
## [v0.22.0](https://github.com/J-F-Liu/lopdf/compare/v0.21.0...v0.22.0) (2019-05-13)
### Add
* Add parsing benchmark.
* Add nom dependency.
### Also
* Also test with nom parsing feature enabled.
### Array
* Array and dictionary parsing.
### Avoid
* Avoid using format! when writing.
### Be
* Be explicit about trait objects.
### Boolean
* Boolean and null parsing.
### Content
* Content parsing.
### Duplicate
* Duplicate pom parser for incremental replacement with nom 5.
### Ease
* Ease off on rayon a bit.
### Escape
* Escape sequence parsing.
### Extern
* extern crate is not required anymore with 2018 edition.
### Fix
* Fix last ugly parser.
* Fix octal parser.
* Fix pdfutil build
### Float
* Float parsing.
### Header
* Header parsing.
### Hex
* Hex string parsing.
### Indirect
* Indirect object and stream parsing.
### Literal
* Literal string syntax.
### Make
* Make sure Stream.start_position is relative to the whole file.
### Merge
* Merge remote-tracking branch 'upstream/master' into nom5
* Merge remote-tracking branch 'upstream/master' into nom5
### More
* More 2018 edition lints.
* More cleanup.
* More cleanup.
* More simplifications.
### Object
* Object id and reference parsing.
### Octal
* Octal and hexadecimal parsing.
### Parallel
* Parallel object stream parsing.
### Rayon
* Rayon usage proof of concept.
### Release
* Release 0.22.0
### Remove
* Remove pom dependency in tests.
### Replace
* Replace name parser.
### Resolve
* Resolve name collisions.
### Simplify
* Simplify lifetime annotations.
### Slowly
* Slowly replace the cute pom parser with nom.
### Trailer
* Trailer and xref start.
### Turns
* Turns out "contained" already exists in nom.
### Unify
* Unify both variants of the parsing functions.
### Use
* Use a BufWriter when saving to path.
* Use parse_at(&self.buffer, offset) to read indirect_object
* Use nom digit testing functions.
* Use lifetime ellision.
* Use nom sequence operators.
### Useless
* Useless move.
### Xref
* Xref stream and trailer parsing.
* Xref parsing.
## [v0.21.0](https://github.com/J-F-Liu/lopdf/compare/v0.20.0...v0.21.0) (2019-04-26)
### Avoid
* Avoid allocating a String.
### Check
* Check offsets read from file to avoid panics
* Check and correct Size entry of trailer dictionary
### Clean
* Clean up bytes_to_string, string_to_bytes iterators
### Fix
* Fix clippy warnings
* Fix .editorconfig
### Fixed
* fixed finally
### Redundant
* Redundant imports with 2018 edition.
### Release
* Release 0.21.0
### Update
* Update example
* Update Cargo.toml
### Use
* Use env_logger in pdfutil
## [v0.20.0](https://github.com/J-F-Liu/lopdf/compare/v0.19.0...v0.20.0) (2019-03-07)
### Release
* Release 0.20.0
### Replace
* Replace println with log macros
### Use
* Use Rust 2018
* Use pom 3.0
## [v0.19.0](https://github.com/J-F-Liu/lopdf/compare/v0.18.0...v0.19.0) (2018-10-24)
### Allow
* Allow xref section has zero entries
### Dictionary
* Dictionary key type changed to Vec
### Format
* Format code with rustfmt
### Improve
* Improve codestyle (simplify loops, remove closures, use is_empty() etc.)
### Move
* Move image dependency to embed_image feature
### Release
* Release 0.19.0
### Skip
* Skip corrupt deflate stream
## [v0.18.0](https://github.com/J-F-Liu/lopdf/compare/v0.17.0...v0.18.0) (2018-10-05)
### Able
* Able to read stream when it's length is in object stream
### Adress
* Adress timezone formatting problem from [#34](https://github.com/J-F-Liu/lopdf/issues/34)
### Insert
* insert image on page
## [v0.17.0](https://github.com/J-F-Liu/lopdf/compare/v0.16.0...v0.17.0) (2018-09-19)
### Make
* Make chrono crate optional
### Release
* Release 0.17.0
### Update
* Update add_barcode example
## [v0.16.0](https://github.com/J-F-Liu/lopdf/compare/v0.15.3...v0.16.0) (2018-09-18)
### Add
* Add form xobject to page
* Add extract_stream subcommand
### Compress
* Compress created Form xobject
### Compress
* compress page content after change
### Fix
* Fix collect_fonts_from_resources for referenced resources
* Fix add xobject to page resources as direct object
## [v0.15.3](https://github.com/J-F-Liu/lopdf/compare/v0.15.0...v0.15.3) (2018-09-14)
### Decompress
* Decompress Form XObject
### Disable
* Disable auto format markdown
### Fix
* Fix bug in reading incremental updated document
* Fix build warning
* Fix string_to_bytes method
### Hexadecimal
* Hexadecimal strings can contain white space.
### Remove
* Remove println in extract_text
### Update
* Update example code
* Update example
## [v0.15.0](https://github.com/J-F-Liu/lopdf/compare/v0.14.1...v0.15.0) (2018-02-04)
### Add
* add `get_object_mut`
* add method as_array_mut
### Extract
* Extract text from specified pages
### Replace
* Replace text of specified page
## [v0.14.1](https://github.com/J-F-Liu/lopdf/compare/v0.13.0...v0.14.1) (2017-11-03)
### Add
* Add `impl From<_> for Object` for more numeric types
* Add an Object::string_literal constructor
* Add a `dictionary!` macro that creates a Dictionary
* Add `impl From for Object` creating Object::Reference
### Derive
* Derive Clone for lopdf::Document
### Release
* Release 0.14.0
### Remove
* Remove the Seek bound on Document::save_to
## [v0.13.0](https://github.com/J-F-Liu/lopdf/compare/v0.11.0...v0.13.0) (2017-10-02)
### Avoid
* Avoid decompress flate stream which has Subtype
### Debug
* Debug with lldb
### Fix
* Fix get_object for created document
### Ignore
* Ignore invalid objects when reading all object in xref table
### Impl
* impl fmt::Debug for Object
### Pdfutil
* pdfutil add extract_pages command
### Read
* Read optional space at the end of xref subsection header line
### Release
* Release 0.13.0
* Release 0.12.0
### Store
* Store compressed stream objects and normal objects together
## [v0.11.0](https://github.com/J-F-Liu/lopdf/compare/v0.10.0...v0.11.0) (2017-08-21)
### Release
* Release 0.11.0
### Use
* Use itoa and dtoa to improve writing performance
## [v0.10.0](https://github.com/J-F-Liu/lopdf/compare/v0.9.0...v0.10.0) (2017-07-20)
### Added
* Added optional allows_compression for Stream object
### Release
* Release 0.10.0
## [v0.9.0](https://github.com/J-F-Liu/lopdf/compare/v0.8.0...v0.9.0) (2017-05-24)
### Add
* Add pdfutil readme
### Added
* Added unit test for load_from() and save_to()
* Added Document::with_version + refactored save() and load()
* Added Debug trait for lopdf::Document
### Apply
* Apply multiple operations in one command
### Build
* Build with Rust stable
* Build with Rust beta
### Fix
* Fix delete_zero_length_streams
### Fixed
* Fixed unit tests
* Fixed breaking API changes
### Release
* Release 0.9.0
## [v0.8.0](https://github.com/J-F-Liu/lopdf/compare/v0.7.0...v0.8.0) (2017-03-16)
### Change
* Change Name(String) to Name(Vec)
### Delete_object
* delete_object and delete_unused_objects
### Get_pages
* get_pages and delete_pages
### Handle
* Handle zero length stream
### Release
* Release 0.8.0
### Traverse
* Traverse objects from trailer recursively
## [v0.7.0](https://github.com/J-F-Liu/lopdf/compare/v0.6.0...v0.7.0) (2017-03-07)
### Add
* Add Content::decode() function
### Build
* Build on Rust 1.17
### Create
* Create String object for DateTime
### Parse
* Parse PDF datetime value
### Read
* Read xref stream in hybrid-reference file
### Update
* Update create_document example
* Update README
## [v0.6.0](https://github.com/J-F-Liu/lopdf/compare/v0.5.0...v0.6.0) (2017-02-16)
### Add
* Add Stream::decompressed_content() method
### Read
* Read previous Xrefs of linearized or incremental updated document
## [v0.5.0](https://github.com/J-F-Liu/lopdf/compare/v0.4.0...v0.5.0) (2017-02-10)
### Add
* Add size field to Xref
* Add Xref struct
### Decode
* Decode PNG frame after FlateDecode
### Read
* Read compressed objects from object stream
* Read xref stream
### Update
* Update README
### Use
* Use pom 0.9.0
### XrefEntry
* XrefEntry as enum type
## [v0.4.0](https://github.com/J-F-Liu/lopdf/compare/v0.3.0...v0.4.0) (2017-01-29)
### Add
* Add Operation constructor
* Add modify_text test
* Add travis-ci build status
* Add FAQ in Readme
* Add print_xref_size() for debuging
### Decode
* Decode content stream
### Encode
* Encode content operations
### Fix
* Fix load_document test
* Fix https://github.com/rust-lang/rust/issues/39177
### Optimize
* Optimize parser code
### Solve
* Solve mutual reference problem between Pages and Page objects
### Trigger
* Trigger new release to pass build on docs.rs
### Update
* Update create PDF example
## [v0.3.0](https://github.com/J-F-Liu/lopdf/compare/v0.2.0...v0.3.0) (2017-01-18)
### Add
* Add compress/decompress subcommands to pdfutil
### Create
* create PDF parser using pom instead of nom
### Dictionary
* Dictionary preserve key insert order
### Update
* Update README
* Update parser to use pom 0.6.0
### Use
* Use reader to get stream length if it is a reference object
## [v0.2.0](https://github.com/J-F-Liu/lopdf/compare/v0.1.0...v0.2.0) (2017-01-05)
### Add
* Add pdfutil program
### Fix
* Fix parsing PDF array error
### Improve
* Improve documentation
## v0.1.0 (2016-12-23)
### Editor
* Editor config
### Impl
* impl Document add_object method
### Improve
* Improve Document::save functional type
### Initial
* Initial commit
### PDF
* PDF objects and document definition
### Parse
* Parse and load PDF document
### Read
* Read objects from xref table instead of sequentially from file stream
### Save
* Save PDF document to file
### Store
* Store max_id as a field of document
lopdf-0.32.0/Cargo.lock 0000644 00000107275 00000000001 0010211 0 ustar # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "adler"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aho-corasick"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04"
dependencies = [
"memchr",
]
[[package]]
name = "android_system_properties"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311"
dependencies = [
"libc",
]
[[package]]
name = "anstream"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163"
dependencies = [
"anstyle",
"anstyle-parse",
"anstyle-query",
"anstyle-wincon",
"colorchoice",
"is-terminal",
"utf8parse",
]
[[package]]
name = "anstyle"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d"
[[package]]
name = "anstyle-parse"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee"
dependencies = [
"utf8parse",
]
[[package]]
name = "anstyle-query"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "anstyle-wincon"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188"
dependencies = [
"anstyle",
"windows-sys 0.48.0",
]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "bit_field"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bumpalo"
version = "3.12.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b"
[[package]]
name = "bytemuck"
version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea"
[[package]]
name = "byteorder"
version = "1.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
[[package]]
name = "cc"
version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chrono"
version = "0.4.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b"
dependencies = [
"iana-time-zone",
"num-integer",
"num-traits",
"winapi",
]
[[package]]
name = "clap"
version = "4.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938"
dependencies = [
"clap_builder",
"clap_derive",
"once_cell",
]
[[package]]
name = "clap_builder"
version = "4.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd"
dependencies = [
"anstream",
"anstyle",
"bitflags",
"clap_lex",
"strsim",
]
[[package]]
name = "clap_derive"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4"
dependencies = [
"heck",
"proc-macro2",
"quote",
"syn 2.0.15",
]
[[package]]
name = "clap_lex"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1"
[[package]]
name = "codespan-reporting"
version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e"
dependencies = [
"termcolor",
"unicode-width",
]
[[package]]
name = "color_quant"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "colorchoice"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
[[package]]
name = "core-foundation-sys"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa"
[[package]]
name = "crc32fast"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
"cfg-if",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200"
dependencies = [
"cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
"cfg-if",
"crossbeam-epoch",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-epoch"
version = "0.9.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46bd5f3f85273295a9d14aedfb86f6aadbff6d8f5295c4a9edb08e819dcf5695"
dependencies = [
"autocfg",
"cfg-if",
"crossbeam-utils",
"memoffset",
"scopeguard",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b"
dependencies = [
"cfg-if",
]
[[package]]
name = "crunchy"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
[[package]]
name = "cxx"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93"
dependencies = [
"cc",
"cxxbridge-flags",
"cxxbridge-macro",
"link-cplusplus",
]
[[package]]
name = "cxx-build"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b"
dependencies = [
"cc",
"codespan-reporting",
"once_cell",
"proc-macro2",
"quote",
"scratch",
"syn 2.0.15",
]
[[package]]
name = "cxxbridge-flags"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb"
[[package]]
name = "cxxbridge-macro"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.15",
]
[[package]]
name = "dirs"
version = "5.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225"
dependencies = [
"dirs-sys",
]
[[package]]
name = "dirs-sys"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c"
dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.48.0",
]
[[package]]
name = "either"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
[[package]]
name = "encoding_rs"
version = "0.8.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394"
dependencies = [
"cfg-if",
]
[[package]]
name = "env_logger"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
dependencies = [
"humantime",
"is-terminal",
"log",
"regex",
"termcolor",
]
[[package]]
name = "errno"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
dependencies = [
"errno-dragonfly",
"libc",
"windows-sys 0.48.0",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "exr"
version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdd2162b720141a91a054640662d3edce3d50a944a50ffca5313cd951abb35b4"
dependencies = [
"bit_field",
"flume",
"half",
"lebe",
"miniz_oxide 0.6.2",
"rayon-core",
"smallvec",
"zune-inflate",
]
[[package]]
name = "fastrand"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
dependencies = [
"instant",
]
[[package]]
name = "fdeflate"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10"
dependencies = [
"simd-adler32",
]
[[package]]
name = "flate2"
version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
dependencies = [
"crc32fast",
"miniz_oxide 0.7.1",
]
[[package]]
name = "flume"
version = "0.10.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577"
dependencies = [
"futures-core",
"futures-sink",
"nanorand",
"pin-project",
"spin",
]
[[package]]
name = "futures-core"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
[[package]]
name = "futures-sink"
version = "0.3.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e"
[[package]]
name = "getrandom"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4"
dependencies = [
"cfg-if",
"js-sys",
"libc",
"wasi",
"wasm-bindgen",
]
[[package]]
name = "gif"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045"
dependencies = [
"color_quant",
"weezl",
]
[[package]]
name = "half"
version = "2.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0"
dependencies = [
"crunchy",
]
[[package]]
name = "heck"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
[[package]]
name = "humantime"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]]
name = "iana-time-zone"
version = "0.1.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c"
dependencies = [
"android_system_properties",
"core-foundation-sys",
"iana-time-zone-haiku",
"js-sys",
"wasm-bindgen",
"windows",
]
[[package]]
name = "iana-time-zone-haiku"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca"
dependencies = [
"cxx",
"cxx-build",
]
[[package]]
name = "image"
version = "0.24.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "527909aa81e20ac3a44803521443a765550f09b5130c2c2fa1ea59c2f8f50a3a"
dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"exr",
"gif",
"jpeg-decoder",
"num-rational",
"num-traits",
"png",
"qoi",
"tiff",
]
[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
"cfg-if",
]
[[package]]
name = "io-lifetimes"
version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220"
dependencies = [
"hermit-abi 0.3.1",
"libc",
"windows-sys 0.48.0",
]
[[package]]
name = "is-terminal"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f"
dependencies = [
"hermit-abi 0.3.1",
"io-lifetimes",
"rustix",
"windows-sys 0.48.0",
]
[[package]]
name = "itoa"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "jpeg-decoder"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e"
dependencies = [
"rayon",
]
[[package]]
name = "js-sys"
version = "0.3.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5"
dependencies = [
"wasm-bindgen",
]
[[package]]
name = "lebe"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8"
[[package]]
name = "libc"
version = "0.2.144"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1"
[[package]]
name = "link-cplusplus"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5"
dependencies = [
"cc",
]
[[package]]
name = "linked-hash-map"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f"
[[package]]
name = "linux-raw-sys"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f"
[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
"autocfg",
"scopeguard",
]
[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
[[package]]
name = "lopdf"
version = "0.32.0"
dependencies = [
"chrono",
"clap",
"encoding_rs",
"env_logger",
"flate2",
"image",
"itoa",
"linked-hash-map",
"log",
"md5",
"nom",
"pom",
"rayon",
"serde",
"serde_json",
"shellexpand",
"tempfile",
"time",
"weezl",
]
[[package]]
name = "md5"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771"
[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
[[package]]
name = "memoffset"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
dependencies = [
"autocfg",
]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]]
name = "miniz_oxide"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
dependencies = [
"adler",
]
[[package]]
name = "miniz_oxide"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
dependencies = [
"adler",
"simd-adler32",
]
[[package]]
name = "nanorand"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3"
dependencies = [
"getrandom",
]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]]
name = "num-integer"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
dependencies = [
"autocfg",
"num-traits",
]
[[package]]
name = "num-rational"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
dependencies = [
"autocfg",
"num-integer",
"num-traits",
]
[[package]]
name = "num-traits"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd"
dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
dependencies = [
"hermit-abi 0.2.6",
"libc",
]
[[package]]
name = "once_cell"
version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "option-ext"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
[[package]]
name = "pin-project"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]]
name = "png"
version = "0.17.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aaeebc51f9e7d2c150d3f3bfeb667f2aa985db5ef1e3d212847bdedb488beeaa"
dependencies = [
"bitflags",
"crc32fast",
"fdeflate",
"flate2",
"miniz_oxide 0.7.1",
]
[[package]]
name = "pom"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e2192780e9f8e282049ff9bffcaa28171e1cb0844f49ed5374e518ae6024ec"
[[package]]
name = "proc-macro2"
version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435"
dependencies = [
"unicode-ident",
]
[[package]]
name = "qoi"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001"
dependencies = [
"bytemuck",
]
[[package]]
name = "quote"
version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rayon"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b"
dependencies = [
"either",
"rayon-core",
]
[[package]]
name = "rayon-core"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"num_cpus",
]
[[package]]
name = "redox_syscall"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
"bitflags",
]
[[package]]
name = "redox_syscall"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
dependencies = [
"bitflags",
]
[[package]]
name = "redox_users"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
dependencies = [
"getrandom",
"redox_syscall 0.2.16",
"thiserror",
]
[[package]]
name = "regex"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
[[package]]
name = "rustix"
version = "0.37.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d"
dependencies = [
"bitflags",
"errno",
"io-lifetimes",
"libc",
"linux-raw-sys",
"windows-sys 0.48.0",
]
[[package]]
name = "ryu"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041"
[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "scratch"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1"
[[package]]
name = "serde"
version = "1.0.162"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.162"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.15",
]
[[package]]
name = "serde_json"
version = "1.0.96"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1"
dependencies = [
"itoa",
"ryu",
"serde",
]
[[package]]
name = "shellexpand"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b"
dependencies = [
"dirs",
]
[[package]]
name = "simd-adler32"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "238abfbb77c1915110ad968465608b68e869e0772622c9656714e73e5a1a522f"
[[package]]
name = "smallvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
[[package]]
name = "spin"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
dependencies = [
"lock_api",
]
[[package]]
name = "strsim"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
[[package]]
name = "syn"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "syn"
version = "2.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "tempfile"
version = "3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998"
dependencies = [
"cfg-if",
"fastrand",
"redox_syscall 0.3.5",
"rustix",
"windows-sys 0.45.0",
]
[[package]]
name = "termcolor"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6"
dependencies = [
"winapi-util",
]
[[package]]
name = "thiserror"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.15",
]
[[package]]
name = "tiff"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7449334f9ff2baf290d55d73983a7d6fa15e01198faef72af07e2a8db851e471"
dependencies = [
"flate2",
"jpeg-decoder",
"weezl",
]
[[package]]
name = "time"
version = "0.3.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc"
dependencies = [
"itoa",
"serde",
"time-core",
"time-macros",
]
[[package]]
name = "time-core"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb"
[[package]]
name = "time-macros"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b"
dependencies = [
"time-core",
]
[[package]]
name = "unicode-ident"
version = "1.0.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4"
[[package]]
name = "unicode-width"
version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b"
[[package]]
name = "utf8parse"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
version = "0.2.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
]
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.15",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.15",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb"
[[package]]
name = "weezl"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb"
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
"winapi",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
dependencies = [
"windows-targets 0.48.0",
]
[[package]]
name = "windows-sys"
version = "0.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
dependencies = [
"windows-targets 0.42.2",
]
[[package]]
name = "windows-sys"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
dependencies = [
"windows-targets 0.48.0",
]
[[package]]
name = "windows-targets"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]]
name = "windows-targets"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
dependencies = [
"windows_aarch64_gnullvm 0.48.0",
"windows_aarch64_msvc 0.48.0",
"windows_i686_gnu 0.48.0",
"windows_i686_msvc 0.48.0",
"windows_x86_64_gnu 0.48.0",
"windows_x86_64_gnullvm 0.48.0",
"windows_x86_64_msvc 0.48.0",
]
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8"
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43"
[[package]]
name = "windows_aarch64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_i686_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f"
[[package]]
name = "windows_i686_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060"
[[package]]
name = "windows_i686_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_x86_64_gnu"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36"
[[package]]
name = "windows_x86_64_gnu"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_msvc"
version = "0.42.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0"
[[package]]
name = "windows_x86_64_msvc"
version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
name = "zune-inflate"
version = "0.2.54"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02"
dependencies = [
"simd-adler32",
]
lopdf-0.32.0/Cargo.toml 0000644 00000004724 00000000001 0010227 0 ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies.
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2021"
name = "lopdf"
version = "0.32.0"
authors = [
"Junfeng Liu ",
"Emulator ",
]
description = "A Rust library for PDF document manipulation."
homepage = "https://github.com/J-F-Liu/lopdf"
documentation = "https://docs.rs/crate/lopdf/"
readme = "README.md"
keywords = [
"pdf",
"editing",
"manipulation",
"merge",
]
categories = ["text-processing"]
license = "MIT"
repository = "https://github.com/J-F-Liu/lopdf.git"
[[example]]
name = "add_barcode"
required-features = ["pom_parser"]
[[example]]
name = "extract_toc"
required-features = ["serde"]
[[example]]
name = "extract_text"
required-features = ["serde"]
[[example]]
name = "rotate"
required-features = ["nom_parser"]
[dependencies.chrono]
version = "^0.4"
features = [
"std",
"clock",
]
optional = true
default-features = false
[dependencies.encoding_rs]
version = "0.8.32"
[dependencies.flate2]
version = "^1.0"
[dependencies.image]
version = "^0.24"
optional = true
[dependencies.itoa]
version = "^1.0"
[dependencies.linked-hash-map]
version = "^0.5"
[dependencies.log]
version = "^0.4"
[dependencies.md5]
version = "0.7.0"
[dependencies.nom]
version = "^7.1"
optional = true
[dependencies.pom]
version = "^3.2"
optional = true
[dependencies.rayon]
version = "^1.6"
optional = true
[dependencies.serde]
version = "1.0"
features = ["derive"]
optional = true
[dependencies.time]
version = "^0.3"
features = [
"formatting",
"parsing",
]
[dependencies.weezl]
version = "0.1"
[dev-dependencies.clap]
version = "4.0"
features = ["derive"]
[dev-dependencies.env_logger]
version = "0.10"
[dev-dependencies.serde_json]
version = "1.0"
[dev-dependencies.shellexpand]
version = "3.0"
[dev-dependencies.tempfile]
version = "3.3"
[features]
chrono_time = ["chrono"]
default = [
"chrono_time",
"nom_parser",
"rayon",
]
embed_image = ["image"]
nom_parser = ["nom"]
pom_parser = ["pom"]
serde = ["dep:serde"]
[badges.travis-ci]
repository = "J-F-Liu/lopdf"
lopdf-0.32.0/Cargo.toml.orig 0000644 0000000 0000000 00000003333 00726746425 0013733 0 ustar 0000000 0000000 [package]
authors = [
"Junfeng Liu ",
"Emulator ",
]
categories = ["text-processing"]
description = "A Rust library for PDF document manipulation."
documentation = "https://docs.rs/crate/lopdf/"
edition = "2021"
homepage = "https://github.com/J-F-Liu/lopdf"
keywords = ["pdf", "editing", "manipulation", "merge"]
license = "MIT"
name = "lopdf"
readme = "README.md"
repository = "https://github.com/J-F-Liu/lopdf.git"
version = "0.32.0"
[dependencies]
chrono = { version = "^0.4", optional = true, features = [
"std",
"clock",
], default-features = false }
encoding_rs = "0.8.32"
flate2 = "^1.0"
image = { version = "^0.24", optional = true }
itoa = "^1.0"
linked-hash-map = "^0.5"
log = "^0.4"
md5 = "0.7.0"
nom = { version = "^7.1", optional = true }
pom = { version = "^3.2", optional = true }
rayon = { version = "^1.6", optional = true }
serde = { version = "1.0", features = ["derive"], optional = true }
time = { version = "^0.3", features = ["formatting", "parsing"] }
weezl = "0.1"
[dev-dependencies]
tempfile = "3.3"
serde_json = "1.0"
clap = { version = "4.0", features = ["derive"] }
shellexpand = "3.0"
env_logger = "0.10"
[features]
chrono_time = ["chrono"]
default = ["chrono_time", "nom_parser", "rayon"]
embed_image = ["image"]
nom_parser = ["nom"]
pom_parser = ["pom"]
serde = ["dep:serde"]
[[example]]
name = "add_barcode"
required-features = ["pom_parser"]
[[example]]
name = "extract_toc"
required-features = ["serde"]
[[example]]
name = "extract_text"
required-features = ["serde"]
[[example]]
name = "rotate"
required-features = ["nom_parser"]
[[tests]]
name = "modify"
required-features = ["pom_parser"]
[badges]
travis-ci = { repository = "J-F-Liu/lopdf" }
lopdf-0.32.0/LICENSE 0000644 0000000 0000000 00000002054 00726746425 0012050 0 ustar 0000000 0000000 MIT License
Copyright (c) 2016 Junfeng Liu
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
lopdf-0.32.0/README.md 0000644 0000000 0000000 00000036572 00726746425 0012336 0 ustar 0000000 0000000 # lopdf
[](https://crates.io/crates/lopdf)
[](https://travis-ci.org/J-F-Liu/lopdf)
[](https://docs.rs/lopdf)
A Rust library for PDF document manipulation.
A useful reference for understanding the PDF file format and the
eventual usage of this library is the
[PDF 1.7 Reference Document](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf).
The PDF 2.0 specification is available [here](https://www.pdfa.org/announcing-no-cost-access-to-iso-32000-2-pdf-2-0/).
## Example Code
* Create PDF document
```rust
use lopdf::dictionary;
use lopdf::{Document, Object, Stream};
use lopdf::content::{Content, Operation};
// with_version specifes the PDF version this document complies with.
let mut doc = Document::with_version("1.5");
// Object IDs are used for cross referencing in PDF documents. `lopdf` helps keep track of them
// for us. They are simple integers.
// Calls to `doc.new_object_id` and `doc.add_object` return an object id
// pages is the root node of the page tree
let pages_id = doc.new_object_id();
// fonts are dictionaries. The type, subtype and basefont tags
// are straight out of the PDF reference manual
//
// The dictionary macro is a helper that allows complex
// key, value relationships to be represented in a simpler
// visual manner, similar to a match statement.
// Dictionary is linkedHashMap of byte vector, and object
let font_id = doc.add_object(dictionary! {
// type of dictionary
"Type" => "Font",
// type of font, type1 is simple postscript font
"Subtype" => "Type1",
// basefont is postscript name of font for type1 font.
// See PDF reference document for more details
"BaseFont" => "Courier",
});
// font dictionaries need to be added into resource dictionaries
// in order to be used.
// Resource dictionaries can contain more than just fonts,
// but normally just contains fonts
// Only one resource dictionary is allowed per page tree root
let resources_id = doc.add_object(dictionary! {
// fonts are actually triplely nested dictionaries. Fun!
"Font" => dictionary! {
// F1 is the font name used when writing text.
// It must be unique in the document. It does not
// have to be F1
"F1" => font_id,
},
});
// Content is a wrapper struct around an operations struct that contains a vector of operations
// The operations struct contains a vector of operations that match up with a particular PDF
// operator and operands.
// Reference the PDF reference for more details on these operators and operands.
// Note, the operators and operands are specified in a reverse order than they
// actually appear in the PDF file itself.
let content = Content {
operations: vec![
// BT begins a text element. it takes no operands
Operation::new("BT", vec![]),
// Tf specifies the font and font size. Font scaling is complicated in PDFs. Reference
// the reference for more info.
// The into() methods are defined based on their paired .from() methods (this
// functionality is built into rust), and are converting the provided values into
// An enum that represents the basic object types in PDF documents.
Operation::new("Tf", vec!["F1".into(), 48.into()]),
// Td adjusts the translation components of the text matrix. When used for the first
// time after BT, it sets the initial text position on the page.
// Note: PDF documents have Y=0 at the bottom. Thus 600 to print text near the top.
Operation::new("Td", vec![100.into(), 600.into()]),
// Tj prints a string literal to the page. By default, this is black text that is
// filled in. There are other operators that can produce various textual effects and
// colors
Operation::new("Tj", vec![Object::string_literal("Hello World!")]),
// ET ends the text element
Operation::new("ET", vec![]),
],
};
// Streams are a dictionary followed by a sequence of bytes. What that sequence of bytes
// represents depends on context
// The stream dictionary is set internally to lopdf and normally doesn't
// need to be manually manipulated. It contains keys such as
// Length, Filter, DecodeParams, etc
//
// content is a stream of encoded content data.
let content_id = doc.add_object(Stream::new(dictionary! {}, content.encode().unwrap()));
// Page is a dictionary that represents one page of a PDF file.
// It has a type, parent and contents
let page_id = doc.add_object(dictionary! {
"Type" => "Page",
"Parent" => pages_id,
"Contents" => content_id,
});
// Again, pages is the root of the page tree. The ID was already created
// at the top of the page, since we needed it to assign to the parent element of the page
// dictionary
//
// This is just the basic requirements for a page tree root object. There are also many
// additional entries that can be added to the dictionary if needed. Some of these can also be
// defined on the page dictionary itself, and not inherited from the page tree root.
let pages = dictionary! {
// Type of dictionary
"Type" => "Pages",
// Vector of page IDs in document. Normally would contain more than one ID and be produced
// using a loop of some kind
"Kids" => vec![page_id.into()],
// Page count
"Count" => 1,
// ID of resources dictionary, defined earlier
"Resources" => resources_id,
// a rectangle that defines the boundaries of the physical or digital media. This is the
// "Page Size"
"MediaBox" => vec![0.into(), 0.into(), 595.into(), 842.into()],
};
// using insert() here, instead of add_object() since the id is already known.
doc.objects.insert(pages_id, Object::Dictionary(pages));
// Creating document catalog.
// There are many more entries allowed in the catalog dictionary.
let catalog_id = doc.add_object(dictionary! {
"Type" => "Catalog",
"Pages" => pages_id,
});
// Root key in trailer is set here to ID of document catalog,
// remainder of trailer is set during doc.save().
doc.trailer.set("Root", catalog_id);
doc.compress();
// Store file in current working directory.
// Note: Line is excluded when running tests
if false {
doc.save("example.pdf").unwrap();
}
```
* Merge PDF documents
```rust
use lopdf::dictionary;
use std::collections::BTreeMap;
use lopdf::content::{Content, Operation};
use lopdf::{Document, Object, ObjectId, Stream, Bookmark};
pub fn generate_fake_document() -> Document {
let mut doc = Document::with_version("1.5");
let pages_id = doc.new_object_id();
let font_id = doc.add_object(dictionary! {
"Type" => "Font",
"Subtype" => "Type1",
"BaseFont" => "Courier",
});
let resources_id = doc.add_object(dictionary! {
"Font" => dictionary! {
"F1" => font_id,
},
});
let content = Content {
operations: vec![
Operation::new("BT", vec![]),
Operation::new("Tf", vec!["F1".into(), 48.into()]),
Operation::new("Td", vec![100.into(), 600.into()]),
Operation::new("Tj", vec![Object::string_literal("Hello World!")]),
Operation::new("ET", vec![]),
],
};
let content_id = doc.add_object(Stream::new(dictionary! {}, content.encode().unwrap()));
let page_id = doc.add_object(dictionary! {
"Type" => "Page",
"Parent" => pages_id,
"Contents" => content_id,
"Resources" => resources_id,
"MediaBox" => vec![0.into(), 0.into(), 595.into(), 842.into()],
});
let pages = dictionary! {
"Type" => "Pages",
"Kids" => vec![page_id.into()],
"Count" => 1,
};
doc.objects.insert(pages_id, Object::Dictionary(pages));
let catalog_id = doc.add_object(dictionary! {
"Type" => "Catalog",
"Pages" => pages_id,
});
doc.trailer.set("Root", catalog_id);
doc
}
fn main() -> std::io::Result<()> {
// Generate a stack of Documents to merge
let documents = vec![
generate_fake_document(),
generate_fake_document(),
generate_fake_document(),
generate_fake_document(),
];
// Define a starting max_id (will be used as start index for object_ids)
let mut max_id = 1;
let mut pagenum = 1;
// Collect all Documents Objects grouped by a map
let mut documents_pages = BTreeMap::new();
let mut documents_objects = BTreeMap::new();
let mut document = Document::with_version("1.5");
for mut doc in documents {
let mut first = false;
doc.renumber_objects_with(max_id);
max_id = doc.max_id + 1;
documents_pages.extend(
doc
.get_pages()
.into_iter()
.map(|(_, object_id)| {
if !first {
let bookmark = Bookmark::new(String::from(format!("Page_{}", pagenum)), [0.0, 0.0, 1.0], 0, object_id);
document.add_bookmark(bookmark, None);
first = true;
pagenum += 1;
}
(
object_id,
doc.get_object(object_id).unwrap().to_owned(),
)
})
.collect::>(),
);
documents_objects.extend(doc.objects);
}
// Catalog and Pages are mandatory
let mut catalog_object: Option<(ObjectId, Object)> = None;
let mut pages_object: Option<(ObjectId, Object)> = None;
// Process all objects except "Page" type
for (object_id, object) in documents_objects.iter() {
// We have to ignore "Page" (as are processed later), "Outlines" and "Outline" objects
// All other objects should be collected and inserted into the main Document
match object.type_name().unwrap_or("") {
"Catalog" => {
// Collect a first "Catalog" object and use it for the future "Pages"
catalog_object = Some((
if let Some((id, _)) = catalog_object {
id
} else {
*object_id
},
object.clone(),
));
}
"Pages" => {
// Collect and update a first "Pages" object and use it for the future "Catalog"
// We have also to merge all dictionaries of the old and the new "Pages" object
if let Ok(dictionary) = object.as_dict() {
let mut dictionary = dictionary.clone();
if let Some((_, ref object)) = pages_object {
if let Ok(old_dictionary) = object.as_dict() {
dictionary.extend(old_dictionary);
}
}
pages_object = Some((
if let Some((id, _)) = pages_object {
id
} else {
*object_id
},
Object::Dictionary(dictionary),
));
}
}
"Page" => {} // Ignored, processed later and separately
"Outlines" => {} // Ignored, not supported yet
"Outline" => {} // Ignored, not supported yet
_ => {
document.objects.insert(*object_id, object.clone());
}
}
}
// If no "Pages" object found abort
if pages_object.is_none() {
println!("Pages root not found.");
return Ok(());
}
// Iterate over all "Page" objects and collect into the parent "Pages" created before
for (object_id, object) in documents_pages.iter() {
if let Ok(dictionary) = object.as_dict() {
let mut dictionary = dictionary.clone();
dictionary.set("Parent", pages_object.as_ref().unwrap().0);
document
.objects
.insert(*object_id, Object::Dictionary(dictionary));
}
}
// If no "Catalog" found abort
if catalog_object.is_none() {
println!("Catalog root not found.");
return Ok(());
}
let catalog_object = catalog_object.unwrap();
let pages_object = pages_object.unwrap();
// Build a new "Pages" with updated fields
if let Ok(dictionary) = pages_object.1.as_dict() {
let mut dictionary = dictionary.clone();
// Set new pages count
dictionary.set("Count", documents_pages.len() as u32);
// Set new "Kids" list (collected from documents pages) for "Pages"
dictionary.set(
"Kids",
documents_pages
.into_iter()
.map(|(object_id, _)| Object::Reference(object_id))
.collect::>(),
);
document
.objects
.insert(pages_object.0, Object::Dictionary(dictionary));
}
// Build a new "Catalog" with updated fields
if let Ok(dictionary) = catalog_object.1.as_dict() {
let mut dictionary = dictionary.clone();
dictionary.set("Pages", pages_object.0);
dictionary.remove(b"Outlines"); // Outlines not supported in merged PDFs
document
.objects
.insert(catalog_object.0, Object::Dictionary(dictionary));
}
document.trailer.set("Root", catalog_object.0);
// Update the max internal ID as wasn't updated before due to direct objects insertion
document.max_id = document.objects.len() as u32;
// Reorder all new Document objects
document.renumber_objects();
//Set any Bookmarks to the First child if they are not set to a page
document.adjust_zero_pages();
//Set all bookmarks to the PDF Object tree then set the Outlines to the Bookmark content map.
if let Some(n) = document.build_outline() {
if let Ok(x) = document.get_object_mut(catalog_object.0) {
if let Object::Dictionary(ref mut dict) = x {
dict.set("Outlines", Object::Reference(n));
}
}
}
document.compress();
// Save the merged PDF
// Store file in current working directory.
// Note: Line is excluded when running tests
if false {
document.save("merged.pdf").unwrap();
}
Ok(())
}
```
* Modify PDF document
```rust
use lopdf::Document;
// For this example to work a parser feature needs to be enabled
#[cfg(any(feature = "pom_parser", feature = "nom_parser"))]
{
let mut doc = Document::load("assets/example.pdf").unwrap();
doc.version = "1.4".to_string();
doc.replace_text(1, "Hello World!", "Modified text!");
// Store file in current working directory.
// Note: Line is excluded when running tests
if false {
doc.save("modified.pdf").unwrap();
}
}
```
## FAQ
* Why does the library keep everything in memory as high-level objects until finally serializing the entire document?
Normally a PDF document won't be very large, ranging from tens of KB to hundreds of MB. Memory size is not a bottle neck for today's computer.
By keeping the whole document in memory, stream length can be pre-calculated, no need to use a reference object for the Length entry,
the resulting PDF file is smaller for distribution and faster for PDF consumers to process.
Producing is a one-time effort, while consuming is many more.
lopdf-0.32.0/assets/AnnotationDemo.pdf 0000644 0000000 0000000 00032213204 00726746425 0015765 0 ustar 0000000 0000000 %PDF-1.7
%
1 0 obj
<>]/BaseState/ON/Creator(Horst Rutter)/Intent/Design/ListMode/AllPages/Locked[]/Name(OCConf)/OFF[]/Order[]/RBGroups[]>>]/D<>]/BaseState/ON/Creator(Horst Rutter)/Intent/Design/ListMode/AllPages/Locked[]/Name(OCConf)/OFF[]/Order[]/RBGroups[]>>/OCGs[]>>/OpenAction<>/S/JavaScript/Type/Action>>/Pages 2 0 R/Requirements[<>]/SpiderInfo 67 0 R/Threads 65 0 R/Type/Catalog/URI<>>>
endobj
9 0 obj
<>
stream
xl0C_%Yv߂q~u[Sm?%Jo]Rtj|MzEQ(`&ˮvtHyj;h)oEcNWV$_!;9~ Ql
endstream
endobj
7 0 obj
<>
stream
endstream
endobj
8 0 obj
<>
stream
endstream
endobj
4 0 obj
<>
stream
0 0 m 0 20.000000 l 20.000000 20.000000 l 20.000000 0 l s
endstream
endobj
5 0 obj
<>
stream
endstream
endobj
6 0 obj
<>
stream
endstream
endobj
28 0 obj
<>/Type/EmbeddedFile>>
stream
xi~s
JdH](Cfg2G!BȔ2%PyH9CPT**$S2Ed뽮cpG8<{
g}w+op6Xkgvm7ExůMk|7|埗^y埗^y埗^y埗^g-wryv㋱SƆD,s\xu</ysޜmyOޓ
xs3īURyu^yA^?yk+5
31OVbظF|5.cXėK}l:w;~'|4I831w-sd~27Mr4s/wr\+ʍr+c:ߥyi:xwjU^O'Džya]n;N[_˯yy^ޕwB%|RFilZq'l|*>r1[Wx>_t>/?ʼ2Ƽ1gUb:~]oX+Ec#W&,bX,˔_{q\gƙqz1gYwb&bbJ|%Nx!^7o^?~x)^8;ΎO'*<|n
xxxxxxxxxxxxxx8]NW2n_wwW}h.9{*_ϏϏOOg##__84>4:_ZvXߊoŗL;L828$CЩ1k[VS1uخk-mt]>>jĜ1gml!fŧ[&{^n|7sE"~?ŏʸ2k',.8>>kbYcGy<?<7%sɜ7o8mn./澹w]r3/s'ʃ<<2SO!bn[*JkgyhZm6|grM F
>gƂx}_Wm{x8Gx*gx<{uvlvQ\zU\ƭX<rZn
qC|3Yx_-3Z7֍}b)qJa
{xƘpYW1ָqm!ᠼ`Ov=9Ok=oX=o/>\rBWsbx
Wq%F+ap*6)\,6Y073/Kϻ]u})?+|tF6̡iaֱulƧՎam CE3L߾z^\gYLǻ9cΘo!ߕʹr;.NS|Y L9w'ؤhF~
W|*ez/Ň77O\|9.+ ۊI[eO=OVljۏGŭbNxckXǖ4^i|r@jx⦅cbⷙbח;}.kg+;29&?8!o(_K/y@03iP~k4CE-æ28FO/kyxxxxxxxxx/_Uzk9s\4;ss;MnS8Kkaa8`[X
p, 1v2|&4ܥhY|xwQgfffff*:0݀o¸14܇8*8]hkqI_kslk8ERa+ݳݹĩ8l?l?5555??;;|qٰ00@
i_Wp\j;j/!w+>9ޓ'ꭻg{\i?KT.K{ύϕQ0[Ζ+
NS&6!"'`8|}>,V]Gy&5C?x7]4}DUbfR3~smqpƁ!r'Gθ4ou=]ĩqjiMAa{IB[,[|k㵅ol'O}<qs|bsq?aUF
dF|y33WnoooZ7盋[t\0rܣxܱp-Y^VxEAt,n'Σ]Dma{~WOm[^jst_|\t]M;MZoa/k|<Ω¥`ɱPW=nصbXbVutp*f
Έ3`:ƹv8s8aھ 3/T]kat*C|o`XƍOII^FߗΥ+>h1qX)W~
',\~'l}l.SbqgYpkZEe@I5;r'G4>
4.8.Z|t7ߊK~hWb/˷K_/TA߁Sk|>J40Mq<ǽ{5ڹv~8?T-\.W6gg6+ܳ8~GѲ!LEx+i34ýra eea9sTjZ.=}+IJ6}bfiy@ =Ii||UbC?o7qs\}*MΓC|,_fF5f-}cίQk\@\ppLkpF<t>/yŭ{90,͆Kq5qM!y:a+pr@w8:Kw=|4=r/N+呸ar䖸%~/^Sc43iv0#>n6n6??n>n>~iRWbE=7|k59+e9k\%y?;:,bX 6w;ߜ<bHΟbɹ:.!yq^i~|ObM-hM[a/^ybWa:ڊGĠov|_/>+uԷb' N|ν7/S~VwXsC;)u|gt]:6q_]r^k Lim{l [G>@Ӷ{j_wgx"ąW+J;gkr,5|ODfa}FsBK!yHt)c+5
ߵ2KLpUn͛_ǿWWT_W-|C=oUէdI
ኸTg!Pϼ'/{qb_}'b=S/87%u;,u+.7x;1O,c[FT߂ZХp="L.S|]af.:~r'^z>>;;.F\z}Cn-x 54kUwg厈#*_9%
M"?SӞ5k7
oq{i6cľؔŧWUqGqC|u"vVcCzAF_ O}X \6~ڑ^C9}i'#^M?sj}sbIFp
VP;[^W-~XV`|SbaO?K~5^kVXB+~^|xN]ϯƥO`b?;lmxX\ʶ=t~O
V>{ROpYyVٔfihVu|Sϫ6. "4ݚnU6WU>V7Ʒ4F?W?͟Vx:H-H?%R5xq&ƹqiazt