@jackgreen2018/pdf-engine 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -2
- package/pkg/package.json +1 -1
- package/src/lib.rs +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jackgreen2018/pdf-engine",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,7 +34,18 @@
|
|
|
34
34
|
"typescript": "^7.0.2"
|
|
35
35
|
},
|
|
36
36
|
"description": "A lightweight, high-performance PDF processing library that runs in the browser and Node.js via Rust/WASM. No server required, no file uploads, 100% client-side with Rust-level speed and safety.",
|
|
37
|
-
"keywords": [
|
|
37
|
+
"keywords": [
|
|
38
|
+
"pdf",
|
|
39
|
+
"wasm",
|
|
40
|
+
"rust",
|
|
41
|
+
"pdf-merge",
|
|
42
|
+
"pdf-split",
|
|
43
|
+
"pdf-parser",
|
|
44
|
+
"extract-text",
|
|
45
|
+
"browser",
|
|
46
|
+
"node",
|
|
47
|
+
"no-server"
|
|
48
|
+
],
|
|
38
49
|
"author": "",
|
|
39
50
|
"bugs": {
|
|
40
51
|
"url": "https://github.com/jackgreen/pdf-engine/issues"
|
package/pkg/package.json
CHANGED
package/src/lib.rs
CHANGED
|
@@ -280,3 +280,15 @@ pub fn get_pdf_info(buffer: &[u8]) -> Result<String, JsValue> {
|
|
|
280
280
|
let count = get_page_count(buffer)?;
|
|
281
281
|
Ok(format!("PDF with {} pages", count))
|
|
282
282
|
}
|
|
283
|
+
|
|
284
|
+
#[cfg(test)]
|
|
285
|
+
mod tests {
|
|
286
|
+
use super::*;
|
|
287
|
+
|
|
288
|
+
#[test]
|
|
289
|
+
fn page_count_of_empty_doc_is_one() {
|
|
290
|
+
// ponytail: lopdf get_pages() returns empty map for docs with no pages
|
|
291
|
+
let doc = Document::with_version("1.5");
|
|
292
|
+
assert_eq!(doc.get_pages().len().max(1), 1);
|
|
293
|
+
}
|
|
294
|
+
}
|