rghost 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rghost/cursor.rb +10 -0
- data/lib/rghost/ruby_to_ps.rb +10 -1
- metadata +2 -2
data/lib/rghost/cursor.rb
CHANGED
@@ -77,6 +77,16 @@ class Cursor < PsObject
|
|
77
77
|
def showpage
|
78
78
|
PsObject.new :showpage
|
79
79
|
end
|
80
|
+
|
81
|
+
#Vai para a pr�xima p�gina com controle de cursores e p�ginas
|
82
|
+
def Cursor.next_page
|
83
|
+
PsObject.new :next_page
|
84
|
+
end
|
85
|
+
#Salta a p�gina sem controle de cursores
|
86
|
+
def Cursor.showpage
|
87
|
+
PsObject.new :showpage
|
88
|
+
end
|
89
|
+
|
80
90
|
|
81
91
|
end
|
82
92
|
|
data/lib/rghost/ruby_to_ps.rb
CHANGED
@@ -4,12 +4,20 @@ module RubyToPs
|
|
4
4
|
#Converte uma string Ruby para string Postscript
|
5
5
|
def to_string(value)
|
6
6
|
#ps escape
|
7
|
-
value=
|
7
|
+
value=pack_string(value)
|
8
8
|
ps_str=ps_escape(value)
|
9
9
|
|
10
10
|
"(#{ps_str}) "
|
11
11
|
|
12
12
|
end
|
13
|
+
def pack_string(s)
|
14
|
+
if RubyGhostConfig::GS[:charset_convert]
|
15
|
+
RubyGhostConfig::GS[:charset_convert].call(s.to_s).to_s
|
16
|
+
else
|
17
|
+
s
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
13
21
|
#Escapa ( e ) para string postscript
|
14
22
|
def ps_escape(value)
|
15
23
|
value.to_s.gsub(/(\(|\))/,'\\\\\1')
|
@@ -51,6 +59,7 @@ module RubyToPs
|
|
51
59
|
# s=string_eval("Page: %current_page% of %count_pages%")
|
52
60
|
#As vari�veis s�o delimitadas por %
|
53
61
|
def string_eval(str)
|
62
|
+
str=pack_string(str)
|
54
63
|
return "(#{ps_escape(str)}) show " unless str =~ /%/
|
55
64
|
|
56
65
|
s=str.scan(/([^%][a-z]*[^%]|\d+%?)|(%[^\s%]+%)/).flatten.compact
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rghost
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.7.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.7.4
|
7
|
+
date: 2007-12-14 00:00:00 -02:00
|
8
8
|
summary: Ruby Ghostscript Engine is a document creation and conversion API, suport(PDF,PS,GIF,TIF,PNG,JPG...). It uses the GhostScript framework for the format conversion, utilizes EPS templates and is optimized to work with larger documents.
|
9
9
|
require_paths:
|
10
10
|
- lib
|