Help us understand the problem. What is going on with this article?

WKWebViewでAirPrintした話と、MacをAirPrintサーバーにしてMacのプリンタでAirPrintした話

More than 5 years have passed since last update.

Stack OverflowにUIWebViewでAirPrintする話が載っていた(airprint - iOS Air print for UIwebview - Stack Overflow)ので、同じようにWKWebViewで出来るかやってみた。

出来た。

WKWebViewでAirPrintした話

以下、WKWebViewのインスタンスはself.wkWebView

    UIPrintInfo *pi = [UIPrintInfo printInfo];
    pi.outputType = UIPrintInfoOutputGeneral;
    pi.jobName = self.wkWebView.title;
    pi.orientation = UIPrintInfoOrientationPortrait;
    pi.duplex = UIPrintInfoDuplexLongEdge;

    UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
    pic.printInfo = pi;
    pic.showsPageRange = YES;
    pic.printFormatter = self.wkWebView.viewPrintFormatter;
    [pic presentAnimated:YES completionHandler:^(UIPrintInteractionController *pic2, BOOL completed, NSError *error) {
        // indicate done or error
    }];

MacをAirPrintサーバーにしてMacのプリンタでAirPrintする

AirPrint対応のプリンタがない開発環境では、
MacをAirPrint Serverにして、
Macに接続されたプリンタからAirPrintすることが出来る。

Netputing » handyPrint v5は、MacをAirPrintサーバーにしてくれるアプリ。

スクリーンショット-2015-04-27-11.33.39.png

上手くいかない場合、設定>共有>プリンタ共有 を有効にする必要があるかも。

niwatako
http://niwatako.tips/
http://niwatako.hatenablog.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした