Skip to content

Commit 9299fff

Browse files
Aspose.PDF for Rust via C++ 25.10
1 parent 30ee285 commit 9299fff

29 files changed

+967
-20
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "asposepdf"
3-
version = "1.25.9"
3+
version = "1.25.10"
44
edition = "2021"
55
license = "MIT"
66
description = "Aspose.PDF for Rust via C++ is a powerful toolkit that allows developers to manipulate PDF files directly and helps do various tasks for PDF. Contains unique features for converting PDF to other formats."

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,35 @@ Contains unique features for converting PDF to other formats.
99

1010
- **Create and manage documents**
1111
- `new`, `open`, `save`, `save_as`, `set_license`
12-
Create, load, save as, and save PDF; apply license keys.
12+
Create, load, save as, and save PDF-document; apply license keys.
13+
- `append`, `append_pages`, `merge_documents`, `split_document`, `split`, `split_at_page`, `split_at`
14+
Append full documents or specific pages; merge multiple PDF-documents; split a PDF-document by page ranges or at a specific page.
1315

1416
- **Page management**
1517
- `add`, `insert`, `delete`, `count`
1618
Add, insert, delete, and count pages in a document.
1719

1820
- **Document-level operations**
1921
- `optimize`, `optimize_resource`, `grayscale`, `rotate`, `set_background`, `repair`
20-
Optimize PDF layout and resources, convert to grayscale, rotate pages, set background, and repair corrupted documents.
22+
Optimize PDF-document layout and resources, convert to grayscale, rotate pages, set background, and repair corrupted documents.
2123
- `replace_text`, `add_page_num`, `add_text_header`, `add_text_footer`, `flatten`
2224
Replace text, add page numbers, insert custom text in the header or footer, and flatten PDF-document.
23-
- `remove_annotations`, `remove_attachments`, `remove_blank_pages`, `remove_bookmarks`, `remove_hidden_text`, `remove_images`, `remove_javascripts`
24-
Remove annotations, attachments, blank pages, bookmarks, hidden text, images, and embedded JavaScript code.
25+
- `remove_annotations`, `remove_attachments`, `remove_blank_pages`, `remove_bookmarks`, `remove_hidden_text`, `remove_images`, `remove_tables`, `remove_javascripts`
26+
Remove annotations, attachments, blank pages, bookmarks, hidden text, images, tables, and embedded JavaScript code.
2527

2628
- **Page-level operations**
2729
- `rotate`, `set_size`, `grayscale`, `add_text`
2830
Rotate individual pages, set page size, convert pages to grayscale, and add text.
2931
- `page_replace_text`, `page_add_page_num`, `page_add_text_header`, `page_add_text_footer`
3032
Replace text on a specific page, add page number to a page, and insert custom text in the header or footer of a page.
31-
- `page_remove_annotations`, `page_remove_hidden_text`, `page_remove_images`
32-
Remove annotations, hidden text, and images on a specific page.
33+
- `page_remove_annotations`, `page_remove_hidden_text`, `page_remove_images`, `page_remove_tables`
34+
Remove annotations, hidden text, images and tables on a specific page.
3335

3436
- **Content extraction**
35-
- `extract_text`
36-
Retrieve plain text content from PDF pages.
37+
- `extract_text`, `bytes`
38+
Retrieve plain text content, and raw data from PDF-document.
3739
- `export_fdf`, `export_xfdf`, `export_xml`
38-
Export data from the previously opened PDF document with AcroForm to FDF, XFDF, or XML formats.
40+
Export data from the previously opened PDF-document with AcroForm to FDF, XFDF, or XML formats.
3941

4042
### PDF converting and saving
4143

@@ -55,6 +57,16 @@ Contains unique features for converting PDF to other formats.
5557
- `about`
5658
Return metadata information about the Aspose.PDF for Rust via C++ with product name, version, release date, and license status.
5759

60+
### PDF analysis
61+
62+
- **Document statistics:**
63+
- `word_count`, `character_count`
64+
Return the number of words and characters in the entire PDF document.
65+
66+
- **Page statistics:**
67+
- `page_word_count`, `page_character_count`, `page_is_blank`
68+
Return the number of words and characters on a specific page and check if a page is blank.
69+
5870
## Platforms
5971

6072
Implemented support for Linux x64, macOS x86_64, macOS arm64 and Windows x64 platforms.

examples/append.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Open the primary PDF-document
5+
let pdf = Document::open("sample.pdf")?;
6+
7+
// Open another PDF-document to append
8+
let another_pdf = Document::open("sample1page.pdf")?;
9+
10+
// Append pages from another PDF-document
11+
pdf.append(&another_pdf)?;
12+
13+
// Save the previously opened PDF-document with new filename
14+
pdf.save_as("sample_append.pdf")?;
15+
16+
Ok(())
17+
}

examples/append_pages.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Open the primary PDF-document
5+
let pdf = Document::open("sample1page.pdf")?;
6+
7+
// Open another PDF-document to append
8+
let another_pdf = Document::open("sample.pdf")?;
9+
10+
// Append specific pages (1 and 3) from another PDF-document
11+
pdf.append_pages(&another_pdf, "1,3")?;
12+
13+
// Save the previously opened PDF-document with new filename
14+
pdf.save_as("sample_append_pages.pdf")?;
15+
16+
Ok(())
17+
}

examples/bytes.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Create a new PDF-document
5+
let pdf = Document::new()?;
6+
7+
// Return the contents of the PDF-document as a byte vector
8+
let data = pdf.bytes()?;
9+
10+
// Print length of the byte vector
11+
println!("Length: {}", data.len());
12+
13+
Ok(())
14+
}

examples/character_count.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Open a PDF-document from file
5+
let pdf = Document::open("sample.pdf")?;
6+
7+
// Return character count in PDF-document
8+
let count = pdf.character_count()?;
9+
10+
// Print the character count
11+
println!("Character count: {}", count);
12+
13+
Ok(())
14+
}

examples/merge_documents.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Create a new PDF-document
5+
let pdf1 = Document::new()?;
6+
7+
// Open a PDF-document named "sample.pdf"
8+
let pdf2 = Document::open("sample.pdf")?;
9+
10+
// Create a new PDF-document by merging the provided PDF-documents
11+
let pdf_merged = Document::merge_documents(&[&pdf1, &pdf2])?;
12+
13+
// Save the previously opened PDF-document with new filename
14+
pdf_merged.save_as("sample_merge_documents.pdf")?;
15+
16+
Ok(())
17+
}

examples/page_character_count.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Open a PDF-document from file
5+
let pdf = Document::open("sample.pdf")?;
6+
7+
// Specify the page number (1-based index)
8+
let page_number = 1;
9+
10+
// Return character count on the specified page
11+
let count = pdf.page_character_count(page_number)?;
12+
13+
// Print the character count
14+
println!("Character count on page {}: {}", page_number, count);
15+
16+
Ok(())
17+
}

examples/page_is_blank.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Open a PDF-document from file
5+
let pdf = Document::open("sample.pdf")?;
6+
7+
// Specify the page number (1-based index)
8+
let page_number = 1;
9+
10+
// Return page is blank in PDF-document
11+
let is_blank = pdf.page_is_blank(page_number)?;
12+
13+
// Print if the specified page is blank
14+
println!("Is page {} blank? {}", page_number, is_blank);
15+
16+
Ok(())
17+
}

examples/page_remove_tables.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use asposepdf::Document;
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
// Open a PDF-document from file
5+
let pdf = Document::open("sample.pdf")?;
6+
7+
// Remove tables in page
8+
pdf.page_remove_tables(1)?;
9+
10+
// Save the previously opened PDF-document with new filename
11+
pdf.save_as("sample_page1_remove_tables.pdf")?;
12+
13+
Ok(())
14+
}

0 commit comments

Comments
 (0)