Xamarin.Forms E-Z Print

Xamarin.Forms E-Z Print

It seems in the age of phones & tablets that are as powerful as computers used to be only a few years ago, with huge amounts of on-board storage and almost always on internet where anything can be looked up instantly, that the days of printing out documents would be over. Well, that’s not the case. There’s something to be said about holding a piece of paper in your hands to consume information from. In some ways, it’s reassuring the data one is looking at is real – not just some pixels on a screen. So it’s inevitable that we’ll be asked to add printing functionality to our apps one day … and if we’re creating a Xamarin.Forms app, there’s a very simple way of doing so. Let’s take a look at how it’s done! Xamarin.Forms E-Z Print First off I want to say that this solution may not be one size fits all. However, I have found it does work in the several use cases I have needed it for, and I wanted to share it with you. (If you just want to jump into some code, you can find a full demo solution on my GitHub here.) Each operating system provides its own printing subsystem. The print engines on the respective platforms can do some pretty amazing things (as with UI graphics, you can go low-level & print in intricate detail). The problem arises when devising a way to give the print engine the content to print… AND ideally having that content be exactly the same type for both operating systems… AND providing the most flexibility for...