Sha256: 4757a69949db47f30c4be57937577e22d220b6947a68279abb36a511d17107ca

Contents?: true

Size: 474 Bytes

Versions: 4

Compression:

Stored size: 474 Bytes

Contents

#!/usr/bin/env ruby

begin
  require 'origami'
rescue LoadError
  ORIGAMIDIR = "#{File.dirname(__FILE__)}/../../../lib"
  $: << ORIGAMIDIR
  require 'origami'
end
include Origami

pdf = PDF.read("sample.pdf", :verbosity => Parser::VERBOSE_DEBUG )

pages = pdf.pages

pages.each do |page| 
  page.onOpen(Action::Named.new(Action::Named::NEXTPAGE)) unless page == pages.last
end
pages.last.onOpen(Action::Named.new(Action::Named::FIRSTPAGE))

pdf.save("loopnamed_sample.pdf")

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
origami-1.2.5 samples/actions/loop/loopnamed.rb
origami-1.2.4 samples/actions/loop/loopnamed.rb
origami-1.2.3 samples/actions/loop/loopnamed.rb
origami-1.2.2 samples/actions/loop/loopnamed.rb