Skip to content

Commit

Permalink
Progressing #47
Browse files Browse the repository at this point in the history
  • Loading branch information
Alastair Carey committed Oct 4, 2022
1 parent c2ed548 commit 596ad97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,8 @@ If you need a binding to a Pdfium function that is not currently available, just
`PdfAttachment::is_empty()` convenience functions; adds `libstdc++` and `libc++` crate features;
adds color conversion functions to `PdfiumLibraryBindings`; corrects bugs in color conversion
when working with `PdfPageImageObject`, as detailed in <https://github.com/ajrcarey/pdfium-render/issues/50>;
corrects some small typos in examples.
fixes a bug in the WASM implementation of `FPDFAnnot_GetAttachmentPoints()`; corrects
some small typos in examples.
* 0.7.20: adds bindings for `FPDFPage_*Thumbnail*()`, `FPDFLink_*()`, and `FPDFText_Find*()` functions;
adds `PdfAttachments::create_attachment_from_bytes()`, `PdfAttachments::create_attachment_from_file()`,
`PdfAttachments::create_attachment_from_reader()`, `PdfAttachments::create_attachment_from_fetch()`,
Expand Down
8 changes: 5 additions & 3 deletions src/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4092,20 +4092,22 @@ impl PdfiumLibraryBindings for WasmPdfiumBindings {

let state = PdfiumRenderWasmState::lock();

let len = quad_index as usize * size_of::<FS_POINTF>();
let len = size_of::<FS_QUADPOINTSF>();

let ptr_quad_points = if len > 0 { state.malloc(len) } else { 0 };
let ptr_quad_points = state.malloc(len);

let result = state
.call(
"FPDFAnnot_GetAttachmentPoints",
JsFunctionArgumentType::Number,
Some(vec![
JsFunctionArgumentType::Pointer,
JsFunctionArgumentType::Number,
JsFunctionArgumentType::Pointer,
]),
Some(&JsValue::from(Array::of2(
Some(&JsValue::from(Array::of3(
&Self::js_value_from_annotation(annot),
&JsValue::from_f64(quad_index as f64),
&Self::js_value_from_offset(ptr_quad_points),
))),
)
Expand Down

0 comments on commit 596ad97

Please sign in to comment.