Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding support for inspecting graphic_state and color_space

  • Loading branch information...
commit 8fb1f8b981eeaf1f85a194658a69673831b66a42 1 parent f41656e
@jonsgreen jonsgreen authored
Showing with 26 additions and 2 deletions.
  1. +26 −2 lib/pdf/inspector/graphics.rb
View
28 lib/pdf/inspector/graphics.rb
@@ -57,11 +57,12 @@ def append_curved_segment(*params)
class Color < Inspector
attr_reader :stroke_color, :fill_color, :stroke_color_count,
- :fill_color_count
-
+ :fill_color_count, :stroke_color_space_count, :color_space
+
def initialize
@stroke_color_count = 0
@fill_color_count = 0
+ @stroke_color_space_count = 0
end
def set_color_for_stroking_and_special(*params)
@@ -73,6 +74,12 @@ def set_color_for_nonstroking_and_special(*params)
@fill_color_count += 1
@fill_color = params
end
+
+ def set_stroke_color_space(*params)
+ @stroke_color_space_count += 1
+ @color_space = params[0]
+ end
+
end
class Dash < Inspector
@@ -126,6 +133,23 @@ def concatenate_matrix(*values)
end
end
+ class State < Inspector
+ attr_reader :save_graphics_state_count, :restore_graphics_state_count
+
+ def initialize
+ @save_graphics_state_count = 0
+ @restore_graphics_state_count = 0
+ end
+
+ def save_graphics_state(*values)
+ @save_graphics_state_count += 1
+ end
+
+ def restore_graphics_state(*values)
+ @restore_graphics_state_count += 1
+ end
+ end
+
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.