rghost 0.8.6.4 → 0.8.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rghost/document.rb +24 -17
- data/lib/rghost/image.rb +6 -3
- metadata +2 -2
data/lib/rghost/document.rb
CHANGED
@@ -74,7 +74,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
74
74
|
#* <tt>:fontsize</tt> - Defines the size of tag :default_font.
|
75
75
|
#* <tt>:row_height and row_padding</tt> - Its names say by itself :)
|
76
76
|
#* <tt>:font_encoding</tt> - Specifies encoding of data input. You can look for supported encoding using the method RGhost::Config.encode_test
|
77
|
-
def initialize(options={})
|
77
|
+
def initialize(options={},&block)
|
78
78
|
super()
|
79
79
|
@head,@callbacks=RGhost::PsObject.new,RGhost::PsObject.new
|
80
80
|
@head.set RGhost::Load.library(:type)
|
@@ -90,7 +90,7 @@ class RGhost::Document < RGhost::PsFacade
|
|
90
90
|
@additional_params=[]
|
91
91
|
|
92
92
|
default_variables
|
93
|
-
|
93
|
+
yield self if block
|
94
94
|
end
|
95
95
|
|
96
96
|
def gs_paper #:nodoc:
|
@@ -251,10 +251,17 @@ class RGhost::Document < RGhost::PsFacade
|
|
251
251
|
# printer.write doc.render_stream(:ps)
|
252
252
|
# printer.close
|
253
253
|
def render_stream(device,options={})
|
254
|
+
# rg=render(device,options)
|
255
|
+
# out=rg.output.readlines.join
|
256
|
+
# rg.clear_output
|
257
|
+
# out
|
258
|
+
|
254
259
|
rg=render(device,options)
|
255
|
-
out=rg.output
|
260
|
+
out=rg.output
|
261
|
+
raise "RGhost::#{rg.errors} - #{out}" if rg.error?
|
262
|
+
data=out.readlines.join
|
256
263
|
rg.clear_output
|
257
|
-
|
264
|
+
data
|
258
265
|
end
|
259
266
|
#Facade to Function.new
|
260
267
|
#Defines low level function to optimize repetitive piece of code.
|
@@ -318,16 +325,16 @@ class RGhost::Document < RGhost::PsFacade
|
|
318
325
|
set RGhost::VirtualPages.new(&block)
|
319
326
|
end
|
320
327
|
{
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
328
|
+
:base => -4,
|
329
|
+
:print => -4,
|
330
|
+
:modify => -8,
|
331
|
+
:copy => -16,
|
332
|
+
:annotate => -32,
|
333
|
+
:interactive => -256,
|
334
|
+
:copy_access => -512,
|
335
|
+
:assemble => -1024,
|
336
|
+
:high_quality_print => -2048,
|
337
|
+
:all => -3904}
|
331
338
|
|
332
339
|
#Security disable the permissions and define passwords to PDF documents.
|
333
340
|
#The password just support set of \w .
|
@@ -359,9 +366,9 @@ class RGhost::Document < RGhost::PsFacade
|
|
359
366
|
# end
|
360
367
|
#
|
361
368
|
def security
|
362
|
-
|
363
|
-
|
364
|
-
|
369
|
+
sec=RGhost::PdfSecurity.new
|
370
|
+
yield sec
|
371
|
+
@additional_params << sec.gs_params
|
365
372
|
end
|
366
373
|
|
367
374
|
#Starts and Ends internal benckmark will write in bottom of page.
|
data/lib/rghost/image.rb
CHANGED
@@ -13,9 +13,12 @@ class RGhost::Image < RGhost::PsObject
|
|
13
13
|
def self.for(path,options={})
|
14
14
|
|
15
15
|
clazz=case path
|
16
|
-
when /gif$/i
|
17
|
-
|
18
|
-
when /
|
16
|
+
when /gif$/i
|
17
|
+
RGhost::Gif
|
18
|
+
when /jpe?g$/i
|
19
|
+
RGhost::Jpeg
|
20
|
+
when /(eps|template)$/i
|
21
|
+
RGhost::Eps
|
19
22
|
else raise NameError.new("Unsupported format")
|
20
23
|
end
|
21
24
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rghost
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.6.
|
4
|
+
version: 0.8.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shairon Toledo
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04-
|
12
|
+
date: 2009-04-20 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|