开发者

Print local html file from uiwebview (iOs)

i need to introduce printing feature to my app, that is made with phonegap framework. there is a solution to implement airpr开发者_运维百科int 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;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜