Skip to content

πŸš€ Make your PDF compliant with press-ready PDF/X-1a.

License

Notifications You must be signed in to change notification settings

t3nro/press-ready

Β 
Β 

Repository files navigation

πŸš€ press-ready
screencast

Make your PDF compliant with press-ready PDF/X-1a.

Build Status Codacy Badge Total alerts

πŸ‡―πŸ‡΅ ζ—₯本θͺž

Table of Contents

Install

via Docker 🐳 (Recommended)

Pull vibranthq/press-ready image from Docker Hub.

docker pull vibranthq/press-ready

then assign an alias for press-ready as a command.

alias press-ready="docker run --rm -it -v \$PWD:/workdir vibranthq/press-ready"

via npm πŸ“¦

npm install -g press-ready # npm
yarn global add press-ready # yarn

and install system dependencies to run press-ready.

macoOS

brew install poppler ghostscript

Ubuntu

apt-get install xpdf ghostscript

Usage

Run press-ready with --input. If --output is missing, output.pdf going to be used for default output path.

press-ready --input <input.pdf> --output <output.pdf>

Run with --help for the help.

➜ press-ready --help
Options:
  --version          Show version number                               [boolean]
  --input            Input file path                                  [required]
  --output           Output file path                  [default: "./output.pdf"]
  --gray-scale       Use gray scale color space instead of CMYK
                                                      [boolean] [default: false]
  --enforce-outline  Convert embedded fonts to outlined fonts          [boolean]
  --boundary-boxes   Add boundary boxes on every page [boolean] [default: false]
  --help             Show help                                         [boolean]

Options

Color Mode

Press-ready will use CMYK by default. Give --gray-scale option to let them use Grayscale instead.

pres-ready
  --input ./input.pdf \
  --output ./output.pdf \
  --gray-scale

Boundary Boxes

Option --boundary-boxes will build TrimBox, CropBox and BleedBox on a generated PDF.

press-ready \
  --input ./input.pdf \
  --output ./output.pdf \
  --boundary-boxes

Outlined Fonts

You might not want to use this option since press-ready automatically guess whether embedded fonts should be outlined. However, you can still control this behavior by passing --enforce-outline or --no-enforce-outline.

press-ready \
  --input ./input.pdf \
  --output ./output.pdf \
  --enforce-outline

Color Profile

Currently, there is only support for Japan 2001 Coated. If you have any suggestions, please consider submitting an issue.

Tips

Lint PDF

press-ready lint --input ./input.pdf

press-ready lint command produces lint result on specified PDF.

==> Linting metadata for './cli/test/fixture/review.pdf'
==> Title Re:VIEWγƒ†γƒ³γƒ—γƒ¬γƒΌγƒˆ
==> Page No. 8
==> PDF version 1.5
==> TrimBox 48.19,66.61,467.72,661.89
==> BleedBox 39.68,58.11,476.22,670.39
==> Listing fonts
name                                      type         embedded  subset
ORFHCM+NimbusSanL-Regu                    Type 1C      yes       yes
JCEWND+NimbusSanL-Bold                    Type 1C      yes       yes
ASNLWJ+NotoSansCJKjp-Bold-Identity-H      CID Type 0C  yes       yes
HPDDST+LMRoman9-Regular                   Type 1C      yes       yes
RJMBNU+NotoSerifCJKjp-Regular-Identity-H  CID Type 0C  yes       yes
==> Every font is properly embedded or no fonts embedded

Pull resource from AWS S3

! This feature is not yet available in press-ready v2. If you need this feature, use press-ready v1 (vibranthq/pdfx) image instead.

Just run with S3 URL: docker run -t vibranthq/press-ready <input s3url> <output s3url>.

For fetching and uploading AWS S3 resources, you need to set env var AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

docker run --rm -it \
  -e AWS_ACCESS_KEY_ID=<aws_key_id> \
  -e AWS_SECRET_ACCESS_KEY=<aws_secret> \
  vibranthq/pdfx s3://bucket/input.pdf s3://bucket/output.pdf

Advanced Usage

Heroku

To run press-ready on Heroku, make sure you add heroku-buildpack-xpdf.

Contribution

PRs are welcome. Make sure to do make test before filing pull requests.

Development Build

make build
make test

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Yasuaki Uechi
Yasuaki Uechi

πŸ’» πŸ“–
Kenshi Muto
Kenshi Muto

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

About

πŸš€ Make your PDF compliant with press-ready PDF/X-1a.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 75.5%
  • HTML 12.9%
  • Makefile 5.7%
  • Dockerfile 4.0%
  • Shell 1.9%