I am trying to print a view I have converted to an image with the toImage method. I have successfully used this method to get an email-able image.
So, following some advice found here, I tried doing the same and saving the image and printing it:
function printList() {
img = vML.toImage();
var file = Titanium.Filesystem.createTempFile(Titanium.Filesystem.resourcesDirectory);
file.write(img);
AirPrint.print({
url : file.nativePath,
showsPageRange : true,
view : printButton
});
}
It goes through the motions of printing (shows popover etc) but then I get this:
[INFO] Printing out file://localhost/var/folders/d6/tpcb4ld91bscf62zcnxvg46m0000gn/T/F915
2012-07-12 12:19:37.127 RoofingCalc[52839:17603] ?\032172\.30\.176\.4\032@\032BLASTOISE._ipp._tcp.local.: Print-Job request failed: Unsupported document-format "image/png".
Unsupported document format? So how does someone print content from their app in Titanium?
sdk 2.01GA2, ios 5.1