page_insert

Вставляет новую страницу в указанную позицию в PDF-document.

pub fn page_insert(&self, num: i32) -> Result<(), PdfError>

Arguments

  • num - the page number (1-based)

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-document из файла
    let pdf = Document::open("sample.pdf")?;

    // Вставьте новую страницу в указанную позицию в PDF-document
    pdf.page_insert(1)?;

    // Сохраните ранее открытый PDF-document
    pdf.save()?;

    Ok(())
}