Module: VivlioStarter::CLI::PdfCommands
- Defined in:
- lib/vivlio_starter/cli/pdf.rb
Overview
================================================================
Module: PDF 生成・圧縮・表示ロジック
提供機能:
- execute_pdf: Vivliostyle CLI による PDF 生成
- execute_pdf_compress: Ghostscript による PDF 圧縮
- execute_open_pdf: macOS Preview.app で PDF を開く
Samovar CLI コマンドから純粋な Hash オプションを受け取る。
Defined Under Namespace
Classes: PdfCommandRunner, PdfCompressor, PdfOpener, PdfPagesExporter, PdfRasterizer, PrintPdfCommandRunner
Class Method Summary collapse
-
.execute_open_pdf(options, path = nil) ⇒ void
PDF を Preview.app で開く.
-
.execute_pdf(options, config_path:, output_path:) ⇒ Boolean
PDF 生成を実行する(パイプライン専用・P4 §3.2).
-
.execute_pdf_compress(options, input = nil, output = nil) ⇒ void
PDF 圧縮を実行する.
-
.execute_pdf_pages(options, input = nil) ⇒ Hash
PDF をページ単位の JPEG に切り出す.
-
.execute_pdf_rasterize(options, input = nil) ⇒ Hash
PDF を JPEG 化して再結合し、Type3 フォントを含まないラスタライズ PDF を生成する.
-
.execute_print_pdf(options, config_path:, output_path:) ⇒ Boolean
入稿用 PDF を生成する(--crop-marks --bleed 付き・パイプライン専用).
Class Method Details
.execute_open_pdf(options, path = nil) ⇒ void
This method returns an undefined value.
PDF を Preview.app で開く
72 73 74 |
# File 'lib/vivlio_starter/cli/pdf.rb', line 72 def execute_open_pdf(, path = nil) PdfOpener.new(, path).call end |
.execute_pdf(options, config_path:, output_path:) ⇒ Boolean
PDF 生成を実行する(パイプライン専用・P4 §3.2)
33 34 35 |
# File 'lib/vivlio_starter/cli/pdf.rb', line 33 def execute_pdf(, config_path:, output_path:) PdfCommandRunner.new(, config_path:, output_path:).call end |
.execute_pdf_compress(options, input = nil, output = nil) ⇒ void
This method returns an undefined value.
PDF 圧縮を実行する
44 45 46 |
# File 'lib/vivlio_starter/cli/pdf.rb', line 44 def execute_pdf_compress(, input = nil, output = nil) PdfCompressor.new(, input, output).call end |
.execute_pdf_pages(options, input = nil) ⇒ Hash
PDF をページ単位の JPEG に切り出す
53 54 55 |
# File 'lib/vivlio_starter/cli/pdf.rb', line 53 def execute_pdf_pages(, input = nil) PdfPagesExporter.new(, input).call end |
.execute_pdf_rasterize(options, input = nil) ⇒ Hash
PDF を JPEG 化して再結合し、Type3 フォントを含まないラスタライズ PDF を生成する
62 63 64 |
# File 'lib/vivlio_starter/cli/pdf.rb', line 62 def execute_pdf_rasterize(, input = nil) PdfRasterizer.new(, input).call end |
.execute_print_pdf(options, config_path:, output_path:) ⇒ Boolean
入稿用 PDF を生成する(--crop-marks --bleed 付き・パイプライン専用)
82 83 84 |
# File 'lib/vivlio_starter/cli/pdf.rb', line 82 def execute_print_pdf(, config_path:, output_path:) PrintPdfCommandRunner.new(, config_path:, output_path:).call end |