Crate pstoedit

source ·
Expand description

Rust bindings to pstoedit.

This crate contains Rust bindings to pstoedit, a C++ program that can translate PostScript and PDF graphics into other vector formats.

§Compatiblity

Multiple versions of pstoedit are supported, but the appropriate feature starting with pstoedit_ has to be enabled.

  • pstoedit_4_00: compatible with pstoedit version 4.00–4.01, and likely with future 4.xx releases.
  • No feature starting with pstoedit_: compatible with pstoedit version 3.17–3.78.

§Usage

First, the init function must be called. Then, interaction with pstoedit is possible using Command or DriverInfo.

§Examples

use pstoedit::{DriverInfo, Command};

pstoedit::init()?;

// For every driver ...
for driver in &DriverInfo::get()? {
    let format = driver.symbolic_name()?;
    let extension = driver.extension()?;
    let output_name = format!("output-{}.{}", format, extension);

    // ... convert input.ps to that format
    Command::new().args_slice(&["-f", format, "input.ps"])?.arg(output_name)?.run()?;
}

Re-exports§

Modules§

Structs§

  • Command builder for generic pstoedit interaction.

Enums§

  • Enumerations of possible errors during interaction with pstoedit.

Functions§

  • Initialize connection to pstoedit. Must be called before calling any other function that requires a connection to pstoedit.

Type Aliases§

  • Type of the result returned by many methods.