*Epic CLI Manual — [index](../MANUAL.md)*

# 5. Transform modes

All transforms write a new PDF to `[output]`; **omit `[output]` and the source is overwritten
in place**. Transforms combine in one command and run in the order given.

## 5.1 Rotate, mirror, resize, create

| Flag | What it does |
|---|---|
| `--rotate90` / `--rotate180` / `--rotate270` | Rotate the page contents. Aliases: `--rotate=90`, `--rot90` (same for 180/270). |
| `--mirror` | Mirror horizontally — reverse-print film and heat-transfer output. |
| `--resize=WxH` | Scale the page — all boxes and contents — to W×H inches. `--resize=8.5x11` sets both sides; `--resize=8.5x` or `--resize=x11` scales proportionally from one side. |
| `--create=WxH` | Start from a new blank W×H-inch page instead of a source file — the usual base for `--imposition` runs. Not a mode by itself; combine it with a transform or an imposition. Note the arg-length guard: very short specs like `--create=4x6` are rejected before the size regex runs — write `--create=4.00x6.00`. |

```
java -jar java-epic-cli.jar --rotate90 in.pdf out.pdf
java -jar java-epic-cli.jar --rotate180 --mirror in.pdf out.pdf
java -jar java-epic-cli.jar --resize=22.5x in.pdf out.pdf
```

## 5.2 `--split`

```
java -jar java-epic-cli.jar --split job.pdf pages/page_%d.pdf
```

Splits the source into single-page PDFs and prints a JSON report (`name`, `pageCount`,
`files` in page order). Naming follows the same `%d` / `_N` convention as `--thin-line`.
With an S3 `[output]` each page uploads individually and the report lists the resulting
`s3://` URLs.

## 5.3 `--swap-spot-colors=SPEC`

```
java -jar java-epic-cli.jar --swap-spot-colors="Spot Gloss=HA Clear:0,0,0,0.3" in.pdf out.pdf
```

Renames spot colors and replaces their CMYK fallback values **throughout the document**:

- page content and resources (Separation and DeviceN colorspaces, including inside form
  XObjects and image XObjects);
- XMP metadata — plate names and swatch groups;
- Illustrator private data — so the file stays consistent when reopened in Illustrator.

SPEC format (quote it in your shell):

```
"Old Name=New Name:C,M,Y,K"
```

`C,M,Y,K` are the new CMYK fallback values, each **0–1**. Chain multiple swaps with
semicolons:

```
"PANTONE 300 C=HA Clear:0,0,0,0.25;Cut Line=HA Adhesive:0,1,0,0"
```
