remove_attachments
Удаляет вложения из PDF-документа.
pub fn remove_attachments(&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>> {
// Откройте PDF‑документ с именем файла
let pdf = Document::open("sample.pdf")?;
// Удалить вложения из PDF-документа
pdf.remove_attachments()?;
// Сохранить ранее открытый PDF-документ с новым именем файла
pdf.save_as("sample_remove_attachments.pdf")?;
Ok(())
}