npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

press-ready

v4.0.3

Published

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

Downloads

1,205

Readme

あなたの PDF をプレス可能な PDF/X-1a に変換しよう。

🇬🇧English

Build Status

必要なもの

  • Docker

使い方

vibranthq/press-ready イメージをDocker Hubから Pull してください。

そして次のコマンドでinput.pdfを変換してoutput.pdfに書き出します:

docker run -it -v $PWD:/workdir vibranthq/press-ready --input <input.pdf> --output <output.pdf>

--input--outputに指定できるのは、現在のフォルダあるいはそのサブフォルダ内のファイルのみです。なぜなら、-vによって現在のフォルダが Docker 内の/workdirにマウントされており、press-ready は/workdirを基準ディレクトリとして動作するからです。

docker pull vibranthq/press-ready

docker run --rm -it \
  -v $PWD:/workdir \
  vibranthq/press-ready \
  --input ./dist/input.pdf \
  --output ./dist/output.pdf

docker run --rm vibranthq/press-ready --helpを実行してヘルプを表示します。

➜ docker run --rm vibranthq/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]

オプション

カラーモード

press-ready はデフォルトでCMYKを使用します。代わりにグレースケールを使用したい場合は --gray-scale を渡してください。

docker run --rm -it \
  -v ${CURDIR}:/workdir \
  vibranthq/press-ready \
  --input ./input.pdf \
  --output ./output.pdf \
  --gray-scale

デジタルトンボ

オプション--boundary-boxesを指定すると、生成された PDF に TrimBox、CropBox、BleedBox が埋め込まれます。

docker run --rm -it \
  -v ${CURDIR}:/workdir \
  vibranthq/press-ready \
  --input ./input.pdf \
  --output ./output.pdf \
  --boundary-boxes

フォントのアウトライン化

press-ready はフォントのアウトライン化が必要かどうかを自動的に判断するので、このオプションを明示的に指定する必要はありません。 しかし、--enforce-outlineあるいは--no-enforce-outlineオプションを渡すことであえて挙動を制御することができます。

docker run --rm -it \
  -v ${CURDIR}:/workdir \
  vibranthq/press-ready \
  --input ./input.pdf \
  --output ./output.pdf \
  --enforce-outline

カラープロファイル

現在、Japan 2001 Coatedのみをサポートしています。もし他のカラープロファイルについて提案がある場合は Issue を立てることを検討してください。

Tips

press-ready コマンド

shell コンフィグに press-ready コマンドを alias することで、長いコマンドをタイプせずに済みます。

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

あとは普通のコマンドと同じように press-ready とタイプするだけです:

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

PDF の検査

docker run --rm -it \
  -v ${CURDIR}:/workdir \
  vibranthq/press-ready lint --input ./input.pdf

press-ready lint コマンドによって 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

AWS S3 のリソースを使用する

! この機能は press-ready v2 ではまだ実装されていません。 もし必要であれば、press-ready v1 (vibranthq/pdfx)イメージを代わりに使用してください。

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

リアルワールド

press-ready を組み込んでいるプロジェクトを教えてください!

  • Re:VIEW の公式 FAQで、PDF を印刷可能なフォーマットに変換する方法の一つとして press-ready が紹介されています。

Advanced Usage

Heroku

Heroku で press-ready を動かす際は、必ず heroku-buildpack-xpdf を導入してpdffontsを使用可能な状態にしてください。

貢献

プルリクエスト大歓迎です!プルリクエストを作成する前に make test でテストを通過するかを確認してください。

開発ビルド

make build
make test

貢献者

素晴らしい貢献者の一覧です! (git shortlog -sn によって作成)

  • Yasuaki Uechi
  • Kenshi Muto