File: document_and_page_options.rb

package info (click to toggle)
ruby-prawn 2.2.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 4,320 kB
  • sloc: ruby: 15,654; sh: 43; makefile: 20
file content (32 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Examples for stamps and repeaters.

require_relative '../example_helper'

filename = File.basename(__FILE__).gsub('.rb', '.pdf')
Prawn::ManualBuilder::Example.generate(filename, page_size: 'FOLIO') do
  package 'document_and_page_options' do |p|
    p.example 'page_size',    eval_source: false, full_source: true
    p.example 'page_margins', eval_source: false, full_source: true
    p.example 'background',   eval_source: false, full_source: true
    p.example 'metadata',     eval_source: false, full_source: true
    p.example 'print_scaling', eval_source: false, full_source: true

    p.intro do
      prose <<-END
        So far we've already seen how to create new documents and start new
        pages. This chapter expands on the previous examples by showing other
        options avialable. Some of the options are only available when creating
        new documents.

        The examples show:
      END

      list(
        'How to configure page size',
        'How to configure page margins',
        'How to use a background image',
        'How to add metadata to the generated PDF'
      )
    end
  end
end