【问题标题】:Print local html file from uiwebview (iOs)从 uiwebview (iOs) 打印本地 html 文件
【发布时间】:2011-05-24 10:13:17
【问题描述】:

我需要在我的应用程序中引入打印功能,这是使用 phonegap 框架制作的。有从javascript实现airprint或使用本机方法的解决方案吗?谢谢。

【问题讨论】:

    标签: ios printing uiwebview cordova airprint


    【解决方案1】:
    【解决方案2】:

    在 Monotouch 中,您可以只截屏:

        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;
        }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-20
      • 1970-01-01
      • 1970-01-01
      • 2013-09-14
      相关资源
      最近更新 更多