Anyone get AirPrint to work with iOS?

Thank you very much for your reply. I’m basically trying to print a full-screen screenshot. I could do the screenshot in the webview via html2canvas but when I press the print-button in the webview nothing happens.

I guess I would somehow have to overlay a native corona print button at the right time in order for it to work?  

I don’t know about printing webViews. But what you might be able to do is have a button in your app that would take the webView (as long as it’s from a website, not a local file) and run it through the SafariView plugin. It might have a print button as it’s a full page widget.

Rob

Slightly tangential to the discussion but it is possible to generate PDFs in Corona (none enterprise) using the lua port of a PDF library (no native components required!). It’s at: luaFpdf.zip - Google Code

It works very well indeed, and it can pull background images in, on which you can overlay text using grid coordinates, and so you have some proforma style capability. We’ve used v1.7 quite a bit now.

The difficulty we still have is printing (grr) - even after the advent of the activity plugin!

It seems that printer service does not respond to (‘see’) the url type item. Apple’s documentation says the print service will respond to NSURL where it refers to a local url, but there seems to be no way in Corona to ‘phrase a url’ to a generated PDF residing in the sandbox’s Documents directory - shame - so near and yet so far!

Any light on this would be most welcome.

Gary

Well back to Enterprise. I did a tutorial a while back that showed how to print and while I was using images, it’s really expecting a PDF.

What happens if you pass the PDF as the image, not the URL?

Rob

Rob - do you have a link to the tutorial to hand?

If I use the following then the printer service does not appear at all - ie. none of the item types trigger it.

local items =

{

      { type = “image”, value = { filename = “gm.pdf”, baseDir = system.ResourceDirectory, } },

    { type = “string”, value = “Hello, World” },

    { type = “url”, value = “http://services.geant.net/cbp/Knowledge_Base/Security/Documents/gn3-na3-t4-ufs126.pdf” },

}

conclusions…

I don’t seem to be able to con it with a PDF as an image as you suggest trying

But also, and more worrying, is that a url to a web PDF does not trigger the printer service - according to the Corona and the Apple documentation this should should at least work as is an NSURL being passed through (supposedly).

 I did get it to work with a real image (an icon from app as per the example), but when this printed the image was clipped and the scaling awful.

I remain puzzled at the practical usefulness of the activity plugin in respect of printing.

Would be a relief If I’d made an error somewhere as this would be a darm useful feature - but I simply copied the example code and used the item table mentioned above.

:-{

Gary

Here:  https://coronalabs.com/blog/2014/04/22/tutorial-image-printing-via-corona-enterprise-ios/

Rob

Thanks for pointing this library out.  Any tutorials on how to use this library to create PDFs in Corona SDK?

Jason