rghost 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,6 +17,7 @@ require 'variable'
17
17
 
18
18
  class RGhost::Document < RGhost::PsFacade
19
19
  include RGhost::DocumentCallbackFacade
20
+ include RGhost::RubyToPs
20
21
  DISABLE_VIRTUAL_PAGE=RGhost::Variable.new(:has_vp?, false)
21
22
  ENABLE_VIRTUAL_PAGE=RGhost::Variable.new(:has_vp?, true)
22
23
  DEFAULT_OPTIONS={
@@ -64,7 +65,7 @@ class RGhost::Document < RGhost::PsFacade
64
65
  @paper=RGhost::Paper.new(options[:paper] || :A4, options)
65
66
  @head.set @paper
66
67
  @done=false
67
-
68
+ @docinfo={:Producer => "Ruby Ghostscript - RGhost v#{RGhost::VERSION::STRING}" }
68
69
  @defines=[]
69
70
 
70
71
  default_variables
@@ -126,8 +127,11 @@ class RGhost::Document < RGhost::PsFacade
126
127
  def ps #:nodoc:
127
128
  done unless @done
128
129
 
130
+
131
+
129
132
  out=RGhost::PsObject.new
130
133
  out.set @head
134
+ out.raw formated_docinfo
131
135
  out.set @default_variables
132
136
  out.set RGhost::Load.rg_enviroment
133
137
  out.raw @defines.join
@@ -384,7 +388,11 @@ class RGhost::Document < RGhost::PsFacade
384
388
  set RGhost::Variable.new(:limit_right, 'source_limit_right')
385
389
 
386
390
  end
387
-
391
+ def informations(docinfo={})
392
+ puts docinfo.inspect
393
+ @docinfo.merge!(docinfo)
394
+ puts @docinfo.inspect
395
+ end
388
396
 
389
397
  # def load_library(name)
390
398
  # raw RGhost::Load.library(name)
@@ -407,6 +415,18 @@ class RGhost::Document < RGhost::PsFacade
407
415
  @head.set RGhost::Variable.new(:default_encoding,@variables[:font_encoding])
408
416
 
409
417
  end
418
+ def formated_docinfo
419
+ d=["["]
420
+
421
+ @docinfo.each do |k,v|
422
+ puts "/#{k} (#{v}) "
423
+ d << "/#{k.to_s.capitalize}"
424
+ d << to_string(v)
425
+ end
426
+ d << "/DOCINFO"
427
+ d << "pdfmark "
428
+ d.join(" ")
429
+ end
410
430
 
411
431
  end
412
432
 
@@ -111,10 +111,10 @@ class RGhost::Grid::Base < RGhost::PsObject
111
111
  # link:images/format01.png
112
112
  def col(title="", options={})
113
113
  if title.is_a? Hash
114
- puts "HASH #{self}::: #{title[:title]}"
114
+
115
115
  @header.col(title[:title],title)
116
116
  else
117
- puts "NOHASH #{self}::: #{title.inspect}"
117
+
118
118
  @header.col(title,options)
119
119
  end
120
120
  end
@@ -37,7 +37,7 @@ class RGhost::Grid::Header < RGhost::PsObject
37
37
  end
38
38
 
39
39
  def ps
40
- puts "TTT#{@titles.inspect}"
40
+
41
41
  p,h=format_header
42
42
  @header.set RGhost::Variable.new(:header_titles,to_array(@titles))
43
43
  @header.set RGhost::Variable.new(:table_params," [\n #{p}] \n")
@@ -48,7 +48,7 @@ class RGhost::Grid::Header < RGhost::PsObject
48
48
  end
49
49
 
50
50
  def col(name="", options={}) #:nodoc:
51
- puts "#{name} <-----> #{options.inspect} "
51
+
52
52
  opts=@default_options.merge(options)
53
53
  @size+=opts[:width]
54
54
  @data_types << opts[:format]
@@ -1,9 +1,9 @@
1
1
  /:rh{ row_height } def
2
2
  /append{
3
- dup cvx exec 3 -1 roll concat ( ) concat def
3
+ dup cvx exec 3 -1 roll _concat ( ) _concat def
4
4
  } def
5
5
 
6
- /concat { exch dup length
6
+ /_concat { exch dup length
7
7
  2 index length add string
8
8
  dup dup 4 2 roll copy length
9
9
  4 -1 roll putinterval
@@ -51,7 +51,7 @@
51
51
  exch pop curstr stringwidth pop ( ) stringwidth pop sub :bw le {
52
52
  /curstr append
53
53
  }{
54
- curstr text_disp ( ) concat /curstr exch def
54
+ curstr text_disp ( ) _concat /curstr exch def
55
55
  :nbw
56
56
  } ifelse
57
57
  }{
@@ -64,7 +64,8 @@ module RGhost::Config
64
64
  :default_params=> %w(gs -dNOPAUSE -dBATCH -dQUIET -dNOPAGEPROMPT),
65
65
  :stack_elements => 5000,
66
66
  :font_encoding => :IsoLatin,
67
- :charset_convert => lambda {|text| Iconv::iconv('latin1','utf8', text) },
67
+ :charset_convert => lambda {|text| Iconv::iconv('latin1','utf-8', text) },
68
+ #:charset_convert => nil,
68
69
  :fontsize => 8,
69
70
  :unit => RGhost::Units::Cm
70
71
  }
@@ -1,7 +1,7 @@
1
1
  module RGhost::VERSION #:nodoc:
2
2
  MAJOR = 0
3
3
  MINOR = 8
4
- TINY = 0
4
+ TINY = 3
5
5
  DATE=1211385093
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
 
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.2
4
+ version: 0.8.3
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: 2008-07-10 00:00:00 -03:00
12
+ date: 2008-07-22 00:00:00 -03:00
13
13
  default_executable:
14
14
  dependencies: []
15
15