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§

pub use driver_info::DriverInfo;

Modules§

driver_info
Information on pstoedit drivers.

Structs§

Command
Command builder for generic pstoedit interaction.

Enums§

Error
Enumerations of possible errors during interaction with pstoedit.

Functions§

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

Type Aliases§

Result
Type of the result returned by many methods.