get_meta_info

Gets meta information value of PDF-document.

pub fn get_meta_info(&self, key: &str) -> Result<String, PdfError>

Arguments

  • key - the key whose value to get

Returns

  • Ok(String) - if the operation succeeds
  • Err(PdfError) - if the operation fails

Example

use asposepdf::Document;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Open a PDF-document with filename
    let pdf = Document::open("sample.pdf")?;

    // Get meta information value of PDF-document
    let author = pdf.get_meta_info("Author")?;

    // Print the result
    println!("Author: {}", author);

    Ok(())
}