Sha256: 072d2778b3f6abadeda684b22439290b708e5fb329cb946384e2047bd39be0ed
Contents?: true
Size: 485 Bytes
Versions: 145
Compression:
Stored size: 485 Bytes
Contents
#!/usr/bin/env ruby require "poppler" if ARGV.size < 1 puts "usage: #{$0} input.pdf" exit(-1) end input, = ARGV output = input.sub(/\..+$/, ".svg") output = "#{output}.svg" if input == output doc = Poppler::Document.new(input) width, height = doc.pages[0].size Cairo::SVGSurface.new(output, width, height) do |surface| surface.restrict_to_version("1_2") context = Cairo::Context.new(surface) doc.each do |page| page.render(context) context.show_page end end
Version data entries
145 entries across 145 versions & 1 rubygems