Skip to content

Commit

Permalink
Resolves #134
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastair Carey committed Feb 21, 2024
1 parent 1124def commit 8409cd9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ available at <https://github.com/ajrcarey/pdfium-render/tree/master/examples>. T
_Note: upcoming release 0.9.0 will remove all deprecated items. For a complete list of deprecated
items, see <https://github.com/ajrcarey/pdfium-render/issues/36>._

Release 0.8.18 adds support for creating new annotations, positioning those annotations,
Release 0.8.19 adds support for creating new annotations, positioning those annotations,
associating them with page objects, and retrieving and setting more annotation properties for each
annotation type. A new `examples/create_annotations.rs` example demonstrates the extended functionality.

Release 0.8.17 adjusts the WASM implementation of `pdfium-render` to account for some small packaging
changes in the upstream releases of Pdfium published at <https://github.com/paulocoutinhox/pdfium-lib/releases>,
and fixes a potential segmentation fault that could occur when dropping a `PdfDocument` while using
a V8/XFA-enabled build of Pdfium.
Releases 0.8.17 and 0.8.18 adjust the WASM implementation of `pdfium-render` to account for some small packaging
changes in the upstream releases of Pdfium published at <https://github.com/paulocoutinhox/pdfium-lib/releases>;
release 0.8.17 also fixes a potential segmentation fault that could occur when dropping a `PdfDocument`
while using a V8/XFA-enabled build of Pdfium.

Release 0.8.16 adds the `PdfBitmap::as_rgba_bytes()` function for retrieving pixel data from a bitmap
that has had its color channels normalized into RGBA irrespective of the original bitmap pixel format,
Expand Down Expand Up @@ -297,8 +297,8 @@ For instance, the following code snippet (taken from a C++ sample):
would translate to the following Rust code:
```rust
let bindings = Pdfium::default().bindings();
let pdfium = Pdfium::default();
let bindings = pdfium.bindings();
let test_doc = "test.pdf";
bindings.FPDF_InitLibrary();
Expand Down Expand Up @@ -345,7 +345,7 @@ functions specific to interactive scripting, user interaction, and printing.
* Releases numbered 0.8.x aim to progressively add support for all remaining Pdfium editing functions to `pdfium-render`.
* Releases numbered 0.9.x aim to fill any remaining gaps in the high-level interface prior to 1.0.

There are 368 `FPDF_*` functions in the Pdfium API. As of version 0.8.17, 325 (88%) have
There are 368 `FPDF_*` functions in the Pdfium API. As of version 0.8.18, 325 (88%) have
bindings available in `PdfiumLibraryBindings`, with the functionality of the majority of these
available via the `pdfium-render` high-level interface.

Expand All @@ -358,7 +358,7 @@ at <https://github.com/ajrcarey/pdfium-render/issues>.

## Version history

* 0.8.18: adds `PdfPageAnnotationAttachmentPoints` struct and matching iterator; adds new annotation functions
* 0.8.19: adds `PdfPageAnnotationAttachmentPoints` struct and matching iterator; adds new annotation functions
to `PdfPageAnnotationCommon` along with their matching implementations in `PdfPageAnnotationPrivate`,
including `PdfPageAnnotationCommon::set_bounds()`, `PdfPageAnnotationCommon::set_position()`,
`PdfPageAnnotationCommon::set_width()`, `PdfPageAnnotationCommon::set_height()`,
Expand All @@ -369,6 +369,11 @@ at <https://github.com/ajrcarey/pdfium-render/issues>.
`chrono::DateTime` types to PDF date strings in `utils::dates`; adds mutability and annotation
creation functions to `PdfPageAnnotations` collection; adds new `create_annotations.rs` example;
adds `PdfPageTextSegment::chars()` convenience function.
* 0.8.18: Adjusts `PdfiumRenderWasmState::bind_to_pdfium()` to fall back to
`Module["wasmExports"]["__indirect_function_table"]` if `Window.wasmTable` global variable is
not available, in response to upstream packaging changes at
<https://github.com/paulocoutinhox/pdfium-lib/releases>. For more details, see
<https://github.com/ajrcarey/pdfium-render/issues/134>.
* 0.8.17: updates all examples (except for `export.rs`) to use extended `Pdfium::default()` implementation
introduced in 0.8.12; fixes a segmentation fault in `PdfDocument::drop()` that can occur when using
a V8/XFA-enabled build of Pdfium; adjusts `PdfiumRenderWasmState::bind_to_pdfium()` to fall back to
Expand Down
6 changes: 2 additions & 4 deletions src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2272,13 +2272,11 @@ pub trait PdfiumLibraryBindings {
#[cfg(test)]
mod tests {
use crate::prelude::*;
use crate::utils::test::test_bind_to_pdfium;

#[test]
fn test_is_true() -> Result<(), PdfiumError> {
let pdfium = Pdfium::new(
Pdfium::bind_to_library(Pdfium::pdfium_platform_library_name_at_path("./"))
.or_else(|_| Pdfium::bind_to_system_library())?,
);
let pdfium = test_bind_to_pdfium();

assert!(!pdfium.bindings().is_true(0));
assert!(pdfium.bindings().is_true(1));
Expand Down

0 comments on commit 8409cd9

Please sign in to comment.