Module: Vivlio::Starter::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, PrintPdfCommandRunner, SingleDocDecider

Class Method Summary collapse

Class Method Details

.execute_open_pdf(options, path = nil) ⇒ void

This method returns an undefined value.

PDF を Preview.app で開く

Parameters:

  • options (Hash)

    オプション

    • :verbose [Boolean] 詳細ログ出力

  • path (String, nil) (defaults to: nil)

    開くPDFパス



53
54
55
# File 'lib/vivlio/starter/cli/pdf.rb', line 53

def execute_open_pdf(options, path = nil)
  PdfOpener.new(options, path).call
end

.execute_pdf(options, target_output = nil) ⇒ void

This method returns an undefined value.

PDF 生成を実行する

Parameters:

  • options (Hash)

    オプション

    • :verbose [Boolean] 詳細ログ出力

  • target_output (String, nil) (defaults to: nil)

    出力ファイル名(リネーム先)



32
33
34
# File 'lib/vivlio/starter/cli/pdf.rb', line 32

def execute_pdf(options, target_output = nil)
  PdfCommandRunner.new(options, target_output).call
end

.execute_pdf_compress(options, input = nil, output = nil) ⇒ void

This method returns an undefined value.

PDF 圧縮を実行する

Parameters:

  • options (Hash)

    オプション

    • :verbose [Boolean] 詳細ログ出力

  • input (String, nil) (defaults to: nil)

    入力PDFパス

  • output (String, nil) (defaults to: nil)

    出力PDFパス



43
44
45
# File 'lib/vivlio/starter/cli/pdf.rb', line 43

def execute_pdf_compress(options, input = nil, output = nil)
  PdfCompressor.new(options, input, output).call
end

.execute_print_pdf(options, target_output = nil) ⇒ void

This method returns an undefined value.

入稿用 PDF を生成する(–crop-marks –bleed 付き)

Parameters:

  • options (Hash)

    オプション

  • target_output (String, nil) (defaults to: nil)

    出力ファイル名



62
63
64
# File 'lib/vivlio/starter/cli/pdf.rb', line 62

def execute_print_pdf(options, target_output = nil)
  PrintPdfCommandRunner.new(options, target_output).call
end