Hack to allow -shift to be used with -add-text to alter position

arbitrarily
This commit is contained in:
John Whitington 2019-09-26 12:30:17 +01:00
parent a4c0aad692
commit 9bc5f38ec6
1 changed files with 4 additions and 2 deletions

View File

@ -1816,7 +1816,9 @@ let addtext
then numstring then numstring
else implode (many '0' (w - String.length numstring)) ^ numstring))] else implode (many '0' (w - String.length numstring)) ^ numstring))]
in in
let shifts = Cpdfcoord.parse_coordinates pdf shift in
let addtext_page num page = let addtext_page num page =
let shift_x, shift_y = List.nth shifts (num - 1) in
let resources', unique_extgstatename = let resources', unique_extgstatename =
if opacity < 1.0 then if opacity < 1.0 then
let dict = let dict =
@ -1891,10 +1893,10 @@ let addtext
in in
match font with match font with
| Some f -> | Some f ->
ops longest_w metrics x y rotate (hoffset +. joffset) voffset outline linewidth ops longest_w metrics (x +. shift_x) (y +. shift_y) rotate (hoffset +. joffset) voffset outline linewidth
unique_fontname unique_extgstatename colour fontsize text unique_fontname unique_extgstatename colour fontsize text
| None -> | None ->
ops longest_w metrics x y rotate (hoffset +. joffset) voffset outline linewidth ops longest_w metrics (x +. shift_x) (y +. shift_y) rotate (hoffset +. joffset) voffset outline linewidth
fontname None colour fontsize text fontname None colour fontsize text
in in
let newresources = let newresources =