Skip to content

Commit

Permalink
Add pdftocairo rule
Browse files Browse the repository at this point in the history
  • Loading branch information
samcarter committed Apr 26, 2024
1 parent c5ab8d2 commit 3329796
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ on.
## [Unreleased]

### Added

* a new `pdftocairo` rule to convert pdf's into various formats.

## [7.1.3] - 2024-02-13

### Added
Expand Down
33 changes: 33 additions & 0 deletions rules/arara-rule-pdftocairo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
!config
identifier: pdftocairo
name: pdftocairo
authors:
- samcarter
commands:
- name: The pdftocairo program
command: >
@{
return getCommand('pdftocairo', '-' + format[0], getBasename(reference.fileName)+'.pdf', options, output);
}
arguments:
- identifier: format
flag: >
@{
return parameters.format;
}
default: png
- identifier: output
flag: >
@{
return parameters.output;
}
- identifier: options
flag: >
@{
if (isList(parameters.options)) {
return parameters.options;
}
else {
throwError('I was expecting a list of options.');
}
}
21 changes: 21 additions & 0 deletions website/content/manual/Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,27 @@ string concatenated with the `pdf` suffix.
% arara: pdftk: { options: [ burst ] }
```

# `pdftocairo`

This rule runs the `pdftocairo` program, which converts Portable Document Format documents to a number of possible output formats using the cairo output device of the poppler PDF library.

- `format` (default: `png`): selects the desired outout format. Possible values are `png`, `jpeg`, `tiff`, `pdf`, `print`, `ps`, `eps` and `svg`.

- `output`: sets the basename of the output file.

- `options`: This option, as the name indicates, takes a list of raw
command line options and appends it to the actual script call. An error is
thrown if any data structure other than a proper list is provided as the
value.

```tex
% arara: pdftocairo: {
% arara: --> format: 'png',
% arara: --> output: 'imagename',
% arara: --> options: [ '-r', '150', '-transp', '-singlefile' ]
% arara: --> }
```

# `perltex`

This rule runs `perltex`, a wrapper that enables a symbiosis between Perl, a
Expand Down

0 comments on commit 3329796

Please sign in to comment.