diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2022-09-12 12:01:08 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-12 12:01:08 -0600 |
| commit | edc2ea29d0d8e5e33615fa4e0757f933fad11f41 (patch) | |
| tree | ab50a2571c89ffeeebdf5fb65d098f4026c5c89e /docs/modules/ROOT | |
| parent | 9d317ad9b213a0562402ff3994534bf4ccbd1d6c (diff) | |
resolves #2337 honor GS_OPTIONS environment variable in RGhost optimizer (PR #2338)
Diffstat (limited to 'docs/modules/ROOT')
| -rw-r--r-- | docs/modules/ROOT/pages/optimize-pdf.adoc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/modules/ROOT/pages/optimize-pdf.adoc b/docs/modules/ROOT/pages/optimize-pdf.adoc index 90abc678..3579073c 100644 --- a/docs/modules/ROOT/pages/optimize-pdf.adoc +++ b/docs/modules/ROOT/pages/optimize-pdf.adoc @@ -1,5 +1,6 @@ = Optimize the PDF -:url-hexapdf: https://hexapdf.gettalong.org/ +:url-hexapdf: https://hexapdf.gettalong.org +:url-gs-pdfwrite: https://ghostscript.com/doc/current/VectorDevices.htm#PDFWRITE By default, Asciidoctor PDF does not optimize the PDF it generates or compresses its streams. This page covers several approaches you can take to optimize your PDF. @@ -61,6 +62,12 @@ Here's how we set the `GS` environment variable using PowerShell in CI: $ echo "$(& where.exe /R 'C:\Program Files\gs' gswin64c.exe)" | Out-File -FilePath $env:GS -Encoding utf8 -Append +If you want to pass additional {url-gs-pdfwrite}[command-line arguments to Ghostscript], you can use the `GS_OPTIONS` environment variable. +The optimizer expects the value to be a space-separated list of arguments (e.g., `-dBlackText`). +For example, here's how you would get the optimizer to generate a grayscale PDF with vectorized text: + + $ GS_OPTIONS='-sColorConversionStrategy=Gray -dNoOutputFonts' asciidoctor-pdf -a optimize filename.adoc + In addition to optimizing the PDF file, you can also configure the optimizer to convert the document from standard PDF to PDF/A or PDF/X. To do so, you can pass one of the following compliance keywords in the value of the optimize attribute: `PDF/A`, `PDF/A-1`, `PDF/A-2`, `PDF/A-3`, `PDF/X`, `PDF/X-1`, or `PDF/X-3`. |
