Class: Ucode::Glyphs::PdftocairoRenderer

Inherits:
PageRenderer show all
Defined in:
lib/ucode/glyphs/pdftocairo_renderer.rb

Overview

‘pdftocairo -svg` from the Poppler suite. Available on macOS via `brew install poppler`. Slower than `mutool` but widely available.

Command: ‘pdftocairo -svg -f <n> -l <n> <in.pdf> <out.svg>`

The ‘-f`/`-l` pair restricts rendering to one page (first/last).

Constant Summary

Constants inherited from PageRenderer

Ucode::Glyphs::PageRenderer::DEFAULT_SMOKE_FIXTURE, Ucode::Glyphs::PageRenderer::OUTPUT_FORMAT

Class Method Summary collapse

Methods inherited from PageRenderer

all, available, available?, default, find, output_format, render, reset_working_cache!, working, works?

Class Method Details

.binary_nameObject



19
20
21
# File 'lib/ucode/glyphs/pdftocairo_renderer.rb', line 19

def binary_name
  :pdftocairo
end

.build_command(pdf_path, page_num, out_path) ⇒ Object



23
24
25
26
27
28
# File 'lib/ucode/glyphs/pdftocairo_renderer.rb', line 23

def build_command(pdf_path, page_num, out_path)
  ["pdftocairo", "-svg",
   "-f", page_num.to_s,
   "-l", page_num.to_s,
   pdf_path.to_s, out_path.to_s]
end

.renderer_nameObject



15
16
17
# File 'lib/ucode/glyphs/pdftocairo_renderer.rb', line 15

def renderer_name
  :pdftocairo
end