text rotation macro for receipts/slips
%ROTATE(degrees)%
%ROTATE(degrees,'extra CSS')%
%ROTATE_END%
Degrees is an integer, but typically you'd use values like 90, -90, 180, 45 etc.
The things between %ROTATE% and %ROTATE_END% macros will be rotated by the
specified number of degrees. Negative values rotate counter-clockwise. Except
for very minimal receipts with judicious use of line breaks, simple rotation
will probably truncate part of whatever is being rotated. So, there's an
'extra CSS' variant where you can specify more CSS to fine tune positioning of
the rotated text/objects.
For an example, try this for a hold_slip template:
Header:
This item needs to be routed to <b>%route_to%</b>:<br/>
Barcode: %item_barcode%<br/>
Title: %item_title%<br/>
<br/>
%ROTATE(90,'position: absolute; top: 150px; left: 100px')%
%hold_for_msg%<br/>
Barcode: %PATRON_BARCODE%<br/>
Notify by phone: %notify_by_phone%<br/>
Notified by text: %notify_by_text%<br/>
Notified by email: %notify_by_email%<br/>
%ROTATE_END%
%ROTATE(760,'position: absolute; top: 150px; left: 50px')%
Line Item:
%formatted_note%<br/>
Footer:
%ROTATE_END%
<br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/>
Request date: %request_date%<br/>
Slip Date: %TODAY_TRIM%<br/>
Printed by %STAFF_FIRSTNAME% at %SHORTNAME%<br/>
<br/>
And then try replacing the
%ROTATE(90,'position: absolute; top: 150px; left: 100px')%
with a mere
%ROTATE(90)%
and note how the text starts overlapping and becomes truncated.
Signed-off-by: Jason Etheridge <jason@esilibrary.com>