pdf-writer 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/ChangeLog +1 -1
  2. data/LICENCE +9 -3
  3. data/README +1 -1
  4. data/bin/techbook +1 -1
  5. data/demo/chunkybacon.rb +1 -1
  6. data/demo/code.rb +1 -1
  7. data/demo/colornames.rb +1 -1
  8. data/demo/demo.rb +1 -1
  9. data/demo/gettysburg.rb +1 -1
  10. data/demo/hello.rb +1 -1
  11. data/demo/individual-i.rb +1 -1
  12. data/demo/pac.rb +1 -1
  13. data/demo/qr-language.rb +4 -4
  14. data/demo/qr-library.rb +1 -1
  15. data/lib/pdf/charts.rb +1 -1
  16. data/lib/pdf/charts/stddev.rb +2 -2
  17. data/lib/pdf/math.rb +1 -1
  18. data/lib/pdf/quickref.rb +17 -15
  19. data/lib/pdf/simpletable.rb +24 -23
  20. data/lib/pdf/techbook.rb +1 -1
  21. data/lib/pdf/writer.rb +21 -52
  22. data/lib/pdf/writer/arc4.rb +1 -1
  23. data/lib/pdf/writer/fontmetrics.rb +2 -1
  24. data/lib/pdf/writer/fonts/MustRead.html +19 -1
  25. data/lib/pdf/writer/graphics.rb +3 -3
  26. data/lib/pdf/writer/graphics/imageinfo.rb +365 -365
  27. data/lib/pdf/writer/lang.rb +1 -1
  28. data/lib/pdf/writer/lang/en.rb +1 -1
  29. data/lib/pdf/writer/object.rb +1 -1
  30. data/lib/pdf/writer/object/action.rb +1 -1
  31. data/lib/pdf/writer/object/annotation.rb +1 -1
  32. data/lib/pdf/writer/object/catalog.rb +1 -1
  33. data/lib/pdf/writer/object/contents.rb +1 -5
  34. data/lib/pdf/writer/object/destination.rb +1 -1
  35. data/lib/pdf/writer/object/encryption.rb +1 -1
  36. data/lib/pdf/writer/object/font.rb +1 -1
  37. data/lib/pdf/writer/object/fontdescriptor.rb +1 -1
  38. data/lib/pdf/writer/object/fontencoding.rb +1 -1
  39. data/lib/pdf/writer/object/image.rb +1 -5
  40. data/lib/pdf/writer/object/info.rb +3 -7
  41. data/lib/pdf/writer/object/outline.rb +1 -1
  42. data/lib/pdf/writer/object/outlines.rb +1 -1
  43. data/lib/pdf/writer/object/page.rb +1 -1
  44. data/lib/pdf/writer/object/pages.rb +1 -1
  45. data/lib/pdf/writer/object/procset.rb +1 -1
  46. data/lib/pdf/writer/object/viewerpreferences.rb +1 -1
  47. data/lib/pdf/writer/ohash.rb +1 -1
  48. data/lib/pdf/writer/oreader.rb +1 -1
  49. data/lib/pdf/writer/state.rb +1 -1
  50. data/lib/pdf/writer/strokestyle.rb +1 -1
  51. data/manual.pwd +1 -1
  52. metadata +115 -119
  53. data/demo/pagenumber.rb +0 -79
@@ -1,79 +0,0 @@
1
- #--
2
- # PDF::Writer for Ruby.
3
- # http://rubyforge.org/projects/ruby-pdf/
4
- # Copyright 2003 - 2005 Austin Ziegler.
5
- #
6
- # Licensed under a MIT-style licence. See LICENCE in the main distribution
7
- # for full licensing information.
8
- #
9
- # $Id: pagenumber.rb,v 1.5.2.1 2005/08/25 03:38:05 austin Exp $
10
- #++
11
- begin
12
- require 'pdf/writer'
13
- rescue LoadError => le
14
- if le.message =~ %r{pdf/writer$}
15
- $LOAD_PATH.unshift("../lib")
16
- require 'pdf/writer'
17
- else
18
- raise
19
- end
20
- end
21
-
22
- def grey_page(pdf)
23
- @page_num ||= 0
24
- @page_num += 1
25
- pdf.save_state
26
- pdf.fill_color Color::RGB::Grey90
27
- x = pdf.margin_x_middle - (pdf.text_width(@page_num, 48) / 2.0)
28
- y = pdf.margin_y_middle - (pdf.font_height(48) / 2.0)
29
- pdf.add_text(x, y, @page_num, 48)
30
- pdf.restore_state
31
- end
32
-
33
- def make_page(pdf)
34
- pdf.start_new_page
35
- grey_page(pdf)
36
- end
37
-
38
- pdf = PDF::Writer.new(:paper => "A10")
39
- pdf.margins_pt 0
40
- pdf.select_font "Helvetica"
41
-
42
- x = pdf.absolute_x_middle
43
-
44
- grey_page(pdf) # Page 1: 99 of 99
45
- sa = pdf.start_page_numbering(x, 70, 9, :center, nil, 99)
46
- pdf.stop_page_numbering(true, :current, sa)
47
- make_page(pdf) # Page 2: 1 of 2
48
- sa = pdf.start_page_numbering(x, 60, 9, nil, nil, 1)
49
- make_page(pdf) # Page 3: 2 of 2
50
- pdf.stop_page_numbering(true, :current, sa)
51
- make_page(pdf) # Page 4: blank
52
- sb = pdf.start_page_numbering(x, 50, 9, :center, nil, 10)
53
- make_page(pdf) # Page 5: 10 of 12
54
- make_page(pdf) # Page 6: 11 of 12
55
- pdf.stop_page_numbering(true, :next, sb)
56
- make_page(pdf) # Page 7: 12 of 12
57
- sc = pdf.start_page_numbering(x, 40, 9, nil, nil, 1)
58
- make_page(pdf) # Page 8: 1 of 3
59
- make_page(pdf) # Page 9: 2 of 3
60
- make_page(pdf) # Page 10: 3 of 3
61
- pdf.stop_page_numbering(true, :current, sc)
62
- make_page(pdf) # Page 11: blank
63
- sd = pdf.start_page_numbering(x, 30, 9, nil, nil, 1)
64
- make_page(pdf) # Page 12: 1 of 6
65
- make_page(pdf) # Page 13: 2 of 6
66
- se = pdf.start_page_numbering(x, 20, 9, nil, nil, 5)
67
- sf = pdf.start_page_numbering(x, 10, 9, :right, nil, 1)
68
- make_page(pdf) # Page 14: 3 of 6, 5 of 10, 1 of 8
69
- make_page(pdf) # Page 15: 4 of 6, 6 of 10, 2 of 8
70
- make_page(pdf) # Page 16: 5 of 6, 7 of 10, 3 of 8
71
- pdf.stop_page_numbering(true, :next, sd)
72
- make_page(pdf) # Page 17: 6 of 6, 8 of 10, 4 of 8
73
- make_page(pdf) # Page 18: 9 of 10, 5 of 8
74
- pdf.stop_page_numbering(true, :next, se)
75
- pdf.stop_page_numbering(false, :current, sf)
76
- make_page(pdf) # Page 19: 10 of 10
77
- make_page(pdf) # Page 20: blank
78
-
79
- pdf.save_as("pagenumber.pdf")