xcode – 在Cocoa中打印WebView的全部内容,而不仅仅是显示

xcode – 在Cocoa中打印WebView的全部内容,而不仅仅是显示,第1张

概述所以我目前正在尝试打印一个我已经加载到 Cocoa应用程序中的WebView的pdf,如果你想看到你需要滚动的整个内容,它的大小.问题在于,无论何时打印,它只打印当前在WebView中显示的内容而不是整个页面,代码如下: [[[[WebView mainFrame] frameView] documentView] print:sender]; 我不确定我是否只是试图打印错误的部分,或者只是需要以 所以我目前正在尝试打印一个我已经加载到 Cocoa应用程序中的WebVIEw的pdf,如果你想看到你需要滚动的整个内容,它的大小.问题在于,无论何时打印,它只打印当前在WebVIEw中显示的内容而不是整个页面,代码如下:
[[[[WebVIEw mainFrame] frameVIEw] documentVIEw] print:sender];

我不确定我是否只是试图打印错误的部分,或者只是需要以另一种方式解决这个问题,并且非常感谢一些帮助.

解决方法 我看到这是一个老问题,但由于还没有任何答案,我想我会为任何搜索提供这个.
nsprintInfo *printInfo = [nsprintInfo sharedPrintInfo];// This is your chance to modify printInfo if you need to change // the page orIEntation,margins,etc[printInfo setorIEntation:NSLandscapeOrIEntation];nsprintoperation *printoperation = [yourWebVIEw.mainFrame.frameVIEw                                     printoperationWithPrintInfo:printInfo];// Open the print dialog[printoperation runoperation];// If you want your print window to appear as a sheet instead of a popup,// use this method instead of -[runoperation][printoperation runoperationModalForWindow:yourWindow                                  delegate:self                             dIDRunSelector:@selector(printDIDRun)                               contextInfo:nil];
总结

以上是内存溢出为你收集整理的xcode – 在Cocoa中打印WebView的全部内容,而不仅仅是显示全部内容,希望文章能够帮你解决xcode – 在Cocoa中打印WebView的全部内容,而不仅仅是显示所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/web/1108295.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存