Skip to content

Commit 1e6d7e7

Browse files
Aspose.PDF for Rust via C++: about
1 parent 12b8748 commit 1e6d7e7

File tree

3 files changed

+121
-0
lines changed

3 files changed

+121
-0
lines changed

english/rust-cpp/_index.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ pub struct Document { /* private fields */ }
9999
| [page_count](./core/page_count/) | Return the number of pages in the PDF-document. |
100100

101101

102+
## Miscellaneous
103+
104+
| Function | Description |
105+
| -------- | ----------- |
106+
| [about](./miscellaneous/about/) | Return metadata information about the Aspose.PDF for Rust via C++. |
107+
108+
102109
# Enums
103110

104111
## Enumeration of possible page size values.
@@ -147,3 +154,29 @@ pub enum Rotation {
147154
}
148155
```
149156

157+
158+
# Structs
159+
160+
## ProductInfo contains metadata about the Aspose.PDF for Rust via C++.
161+
```rust
162+
#[derive(Debug, Deserialize)]
163+
pub struct ProductInfo {
164+
#[serde(rename = "product")]
165+
pub product: String,
166+
167+
#[serde(rename = "family")]
168+
pub family: String,
169+
170+
#[serde(rename = "version")]
171+
pub version: String,
172+
173+
#[serde(rename = "releasedate")]
174+
pub release_date: String,
175+
176+
#[serde(rename = "producer")]
177+
pub producer: String,
178+
179+
#[serde(rename = "islicensed")]
180+
pub is_licensed: bool,
181+
}
182+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: "Miscellaneous functions"
3+
second_title: Aspose.PDF for Rust via C++
4+
description: "Miscellaneous functions for working."
5+
type: docs
6+
url: /rust-cpp/miscellaneous/
7+
---
8+
9+
## Miscellaneous
10+
11+
| Function | Description |
12+
| -------- | ----------- |
13+
| [about](./about/) | Return metadata information about the Aspose.PDF for Rust via C++. |
14+
15+
16+
## Detailed Description
17+
18+
Miscellaneous functions for working.
19+
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: "about"
3+
second_title: Aspose.PDF for Rust via C++
4+
description: "Returns metadata information about the Aspose.PDF for Rust via C++."
5+
type: docs
6+
url: /rust-cpp/miscellaneous/about/
7+
---
8+
9+
_Returns metadata information about the Aspose.PDF for Rust via C++._
10+
11+
```rust
12+
pub fn about(&self) -> Result<ProductInfo, PdfError>
13+
```
14+
15+
**Arguments**
16+
17+
18+
**Returns**
19+
* **Ok(ProductInfo)** - if the operation succeeds
20+
```rust
21+
#[derive(Debug, Deserialize)]
22+
pub struct ProductInfo {
23+
#[serde(rename = "product")]
24+
pub product: String,
25+
26+
#[serde(rename = "family")]
27+
pub family: String,
28+
29+
#[serde(rename = "version")]
30+
pub version: String,
31+
32+
#[serde(rename = "releasedate")]
33+
pub release_date: String,
34+
35+
#[serde(rename = "producer")]
36+
pub producer: String,
37+
38+
#[serde(rename = "islicensed")]
39+
pub is_licensed: bool,
40+
}
41+
```
42+
43+
* **Err(PdfError)** - if the operation fails
44+
45+
**Example**
46+
47+
```rust
48+
use asposepdf::Document;
49+
50+
fn main() -> Result<(), Box<dyn std::error::Error>> {
51+
// Create a new PDF-document
52+
let pdf = Document::new()?;
53+
54+
// Return metadata information about the Aspose.PDF for Go via C++.
55+
let info = pdf.about()?;
56+
57+
// Print metadata fields
58+
println!("Product Info:");
59+
println!(" Product: {}", info.product);
60+
println!(" Family: {}", info.family);
61+
println!(" Version: {}", info.version);
62+
println!(" ReleaseDate: {}", info.release_date);
63+
println!(" Producer: {}", info.producer);
64+
println!(" IsLicensed: {}", info.is_licensed);
65+
66+
Ok(())
67+
}
68+
69+
```

0 commit comments

Comments
 (0)