问题描述:

i need to introduce printing feature to my app, that is made with phonegap framework. there is a solution to implement airprint from javascript or use native method? thanks.

网友答案:

Create a plugin for phonegap using the code suggested here...

https://groups.google.com/forum/#!topic/phonegap/nAt0TqsStgc

which will point you to

http://marceloprogramming.blogspot.com/2010/12/resolving-runtime-issues-with-airprint.html

网友答案:

You could , in Monotouch, just take a screen shot:

    public class ScreenShot
{
    public static UIImage TakeScreenShot (UIView view)
    {
        RectangleF canvasRect = view.Bounds;
        UIGraphics.BeginImageContext (canvasRect.Size);

        CGContext ctx = UIGraphics.GetCurrentContext ();
        ctx.FillRect (canvasRect);
        view.Layer.RenderInContext (ctx);

        UIImage newImage = UIGraphics.GetImageFromCurrentImageContext ();

        UIGraphics.EndImageContext ();

        return newImage;
    }
}
相关阅读:
Top