Skip to main content

A command line utility that exports omnigraffle canvases files into various formats with a rubber support.

Project description

# OmniGraffle Export tool

A command line tool that allows to export one or more canvases from [OmniGraffle](http://www.omnigroup.com/products/omnigraffle/) into various formats using [OmniGraffle AppleScript interface](http://www.omnigroup.com/mailman/archive/omnigraffle-users/2008/004785.html).
It is compatible with [rubber](https://launchpad.net/rubber) and can be configured to automatically export figures out of .graffle file.

## Installation

In order to have it successfully installed and working, following is required:

* OmniGraffle 5
* python >= 2.6
* [appscript](http://appscript.sourceforge.net/py-appscript/index.html) >= 0.22

You can either clone the repository and use the setup tool:

setup.py install

Or using the PIP:

pip install omnigraffle_export

## Usage

Usage: omnigraffle-export [options] <source> <target>

Options:
-h, --help show this help message and exit
-c NAME canvas name. If not given it will be guessed from the target
filename unless it is a directory.
-f FMT format (one of: pdf, png, svg, eps). Guessed from the target
filename suffix unless it is a directory. Defaults to pdf
--force force the export
-v verbose

If the target file exists it tries to determine whether the canvas has been changed. It does that by comparing the checkums. Since the PDF export always results into a different file, it uses the PDF subject attribute to store there a checksum that will be generated by exporting to a PNG format.

## Examples

* Export _all_ canvases into directory _figures_ using EPS

`omnigraffle-export -f eps schemas.graffle figures`

* Export canvas named _FullModel_ into a _FullModel.svg_ SVG file:

`omnigraffle-export schemas.graffle FullModel.svg`

* Export canvas name _FullModel_ into a _my_new_model.pdf_ PDF file:

`omnigraffle-export -c FullModel -f pdf schemas.graffle my_new_model`

or

`omnigraffle-export -c FullModel schemas.graffle my_new_model.pdf`

_Note: that the '.pdf' suffix will be automatically added in the first case._

* Export _all_ canvases into directory _figures_ using EPS

`omnigraffle-export -f eps schemas.graffle figures`

## LaTeX support via rubber

### Rubber

Rubber is a program whose purpose is to handle all tasks related to the compilation of LaTeX documents. This includes compiling the document itself, of course, enough times so that all references are defined, and running BibTeX to manage bibliographic references. Automatic execution of dvips to produce PostScript documents is also included, as well as usage of pdfLaTeX to produce PDF documents.

### Setup

Rubber uses `rules.ini` file to configure conversion options. In order to allow to use OmniGraffle Export, following needs to be added to the `rules.ini` (with the appropriate path alteration):

[convert-omnigraffle]
target = (.*):(.*)\.(eps|pdf)
source = \1.graffle
cost = 0
rule = shell
command = /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/omnigraffle-export-rubber $target
message = converting omigraffle $source into $target

This can be done automatically by executing the `setup-rubber.sh` script as root

### Usage

Following is an example how to include a canvas named `Canvas1` from file `figures/schema.graffle`:

\begin{figure}
\centering
\includegraphics[width=\textwidth]{figures/schema:Canvas1.pdf}
\caption{Example of a OmniGraffle figure}
\end{figure}

The notation is `<path_to_graffle_file_without_dot_graffle_suffix>:<canvas_name>`

Project details


Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page