save

Saves the previously opened PDF-document.

pub fn save(&self) -> Result<(), PdfError>

Arguments

Returns

  • Ok(()) - 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 named "sample.pdf"
    let pdf = Document::open("sample.pdf")?;

    // Save the previously opened PDF-document
    pdf.save()?;

    Ok(())
}