Print format content overflow

Is there any means to control content overflow in print format dynamically?
I am trying to print price tags and want to dynamically control content overflow by reducing some lines of content or the font size .

As far as i remember, using javascript one could do so in earlier versions but its not rendering correctly during print but shows fine in print preview.

Any update on since when server scripts would be supported again in erpnext print formats so that javascript works/recognized at print.