How can I sort items in Order Printer app by vendor or tag?

Its there any possible way to sort items in the Order Print by the Vendor or Tag, in this case must be numbers so we can sort them from 0 to 20.

Can someone help me on the code for this in case i need to order line.items from 1 to 20 using Vendor attribute.