Skip to content

Commit

Permalink
PageState: add a method for performing a CTM transform
Browse files Browse the repository at this point in the history
  • Loading branch information
yob committed Feb 18, 2012
1 parent fd25ba0 commit cf8f730
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/pdf/reader/page_state.rb
Expand Up @@ -195,6 +195,16 @@ def invoke_xobject(label)
# Public Visible State
#####################################################

# transform x and y co-ordinates from the current user space to the
# underlying device space.
#
def ctm_transform(x, y, z = 1)
[
(ctm[0,0] * x) + (ctm[1,0] * y) + (ctm[2,0] * z),
(ctm[0,1] * x) + (ctm[1,1] * y) + (ctm[2,1] * z)
]
end

# transform x and y co-ordinates from the current text space to the
# underlying device space.
#
Expand Down

0 comments on commit cf8f730

Please sign in to comment.