prawn-templates 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pdf/core/document_state.rb +1 -0
- data/lib/pdf/core/object_store.rb +2 -0
- data/lib/pdf/core/page.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4675a2da68897899907ad2cd9ca41f965795c529
|
4
|
+
data.tar.gz: dad0a841287c217ba076dcdf054d8f406a5921b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f26464256ebf5e75af2744dac364cc02299f81953a3f2edd8298987d9ec8e81abadc15b97bc838dad6feade30572aa9b7f9f21fa1cc7434ed86113777c38dc3
|
7
|
+
data.tar.gz: 52fa48e4bdc6371d89fbf2a5ddebfbad0867465f65eae7458f0021e8e140c659c47fe673454482eb25a521d8be32b9f5b169e03f91ee61cff705140bb77eaee9
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module PDF
|
2
2
|
module Core
|
3
3
|
class ObjectStore #:nodoc:
|
4
|
+
alias __initialize initialize
|
4
5
|
def initialize(opts = {})
|
5
6
|
@objects = {}
|
6
7
|
@identifiers = []
|
@@ -17,6 +18,7 @@ module PDF
|
|
17
18
|
end
|
18
19
|
end
|
19
20
|
|
21
|
+
alias __utf8? utf8? if method_defined? :utf8?
|
20
22
|
def utf8?(str)
|
21
23
|
str.force_encoding(::Encoding::UTF_8)
|
22
24
|
str.valid_encoding?
|
data/lib/pdf/core/page.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
module PDF
|
2
2
|
module Core
|
3
3
|
class Page #:nodoc:
|
4
|
+
alias __initialize initialize
|
4
5
|
def initialize(document, options = {})
|
5
6
|
@document = document
|
6
7
|
@margins = options[:margins] || {
|
@@ -36,10 +37,13 @@ module PDF
|
|
36
37
|
document.open_graphics_state
|
37
38
|
end
|
38
39
|
|
39
|
-
|
40
|
-
|
40
|
+
unless method_defined? :imported_page?
|
41
|
+
def imported_page?
|
42
|
+
@imported_page
|
43
|
+
end
|
41
44
|
end
|
42
45
|
|
46
|
+
alias __dimensions dimensions if method_defined? :dimensions
|
43
47
|
def dimensions
|
44
48
|
return inherited_dictionary_value(:MediaBox) if imported_page?
|
45
49
|
|
@@ -56,6 +60,9 @@ module PDF
|
|
56
60
|
end
|
57
61
|
end
|
58
62
|
|
63
|
+
if method_defined? :init_from_object
|
64
|
+
alias __init_from_object init_from_object
|
65
|
+
end
|
59
66
|
def init_from_object(options)
|
60
67
|
@dictionary = options[:object_id].to_i
|
61
68
|
if options[:page_template]
|
@@ -71,6 +78,7 @@ module PDF
|
|
71
78
|
@imported_page = true
|
72
79
|
end
|
73
80
|
|
81
|
+
alias __init_new_page init_new_page if method_defined? :init_new_page
|
74
82
|
def init_new_page(options)
|
75
83
|
@size = options[:size] || 'LETTER'
|
76
84
|
@layout = options[:layout] || :portrait
|