iPhone 和打印机集成 用于自定义应用程序开发的示例代码/API

发布于 2024-08-11 04:11:10 字数 222 浏览 4 评论 0原文

我最近的参与要求使用 iPhone 进行打印机集成。该应用程序将

• 使用收集的数据生成 PDF • 当用户单击打印按钮时打印相同的内容

我在 iPhone 开发方面相当陌生。几乎没有任何参考和示例代码支持打印功能,但是市场上有很多应用程序可以从 iPhone 进行打印!

请帮助我提供参考或示例代码,以在我们正在构建的自定义应用程序中实现该功能。

非常感谢 -吉特

My recent engagement demands a printer integration using iPhone. The app will

• Generate a PDF with the collected data
• Print the same when user clicks print button

I am fairly new in iPhone development. There are hardly any reference and sample codes to support the printing feature , however there are quite a few apps available in the market to print from iPhone!

Please help me with reference or sample code to realize the feature from within the custom app we are building.

Many Thanks
-Jeet

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

戏剧牡丹亭 2024-08-18 04:11:10

我还没有开发出支持打印的应用程序,但是,我很确定支持打印的应用程序必须连接到在 iPhone 应用程序连接到并发送其数据的同一 wifi 网络上的某台计算机上运行的配套 OS X 应用程序到。

这意味着您必须查看桌面的打印文档和示例代码,并构建一个帮助应用程序来接收来自 iPhone 应用程序的连接。有示例代码向您展示如何使用 Bonjour 发现网络上的计算机。然后,您可以使用套接字通过网络将数据从 iPhone 传输到桌面应用程序,并让它传递打印作业。

你说你对 iPhone 开发相当陌生,所以这里有一个警告,它不适合胆小的人。

以下是一篇关于如何使用 Bonjour 在桌面和 iPhone 之间进行通信的博客文章:

http://cocoa-nut .de/?p=27

谨致问候,

I haven't developed an app that supports printing, however, I'm pretty sure the ones that do must be connecting to a companion OS X application running on some computer on the same wifi network that the iPhone app connects to and sends its data to.

This means that you'll have to look at the printing docs and sample code for the Desktop and build a helper app that will receive connections from your iPhone app. There is sample code to show you how to discover a computer on your network using Bonjour. You can then just stream the data over the network using a socket to the Desktop app from the iPhone and have it pass along the print job.

You say that you're fairly new to iPhone development, so this comes with a warning that it's not for the faint of heart.

Here is a blog post on how to communicate between desktop and iPhone using Bonjour:

http://cocoa-nut.de/?p=27

Best Regards,

救星 2024-08-18 04:11:10

我也在寻找相同的解决方案,因为我需要为我正在开发的应用程序执行此操作。我还生成 PDF,然后用户可以打印它。

正如您所说,已经开发的应用程序无需使用中间 PC 即可进行打印。但是,在网上搜索时,我发现了一个对于 Epson 打印非常有用的应用程序

http:// mobile.eurosmartz.com/products/print.html

该公司自己提到,“在您的 iPhone 上安装“Print”,为您的台式机/笔记本电脑下载免费的 WePrint 软件,然后您就可以打印直接从你的 iPhone 上。”

iTunes 上还有另一个应用程序,名为“PrinterShare-从 iPhone 打印到任何地方”。他们还提到连接打印机的计算机需要 PrinterShare 软件。

所以我认为这些印刷品中存在着一个调解者。

如果您找到有关此主题的更多信息,请告诉我,因为这是非常新的,客户要求在应用程序中使用此功能。

如果您了解任何示例应用程序

问候,
维沙尔。

I am also looking for the same solution as I need to do this for the application that I am working on. I am also generating the PDF and user can then print it.

As you are saying that already developed apps are printing without using intermediate PC. But while searching over the net I came around an application which is useful for printing for Epson

http://mobile.eurosmartz.com/products/print.html

There it is mentioned by the company it self that "Install “Print” on your iPhone, download the free WePrint software for your desktop/laptop computer and then you can print directly from your iPhone."

Also there is another application on iTunes called "PrinterShare- print from iPhone to anywhere". There also they mentioned that computer connected to printer needs the PrinterShare software.

So I think there is a mediator present in these printings.

Let me know if you find some more information on this topic, as this is very new and clients are asking to avail this facility in there applications.

If you come to know any sample application

Regards,
Vishal.

绝不放开 2024-08-18 04:11:10

目前没有官方打印API。

您当然可以实现自己的 LPR 打印代码。

或者,您可以从 www.e-workshop-dev 之类的人处许可现成的 API。 com

There is currently no Official printing API.

You could of course implement your own LPR printing code.

Or you can license a ready API from someone like www.e-workshop-dev.com

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文