|
| 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