使用我自己的应用程序通过电子邮件将单页pdf文件作为附件从iPad发送 [英] Emailing single page pdf file as an attachment from iPad using my own app

查看:230
本文介绍了使用我自己的应用程序通过电子邮件将单页pdf文件作为附件从iPad发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的ios app中,用户可以将pdf文件作为附件发送给其他人。它正在使用pre ios 7设备。升级到ios 7后,当app呈现ios邮件界面时,附件丢失了。

In my ios app user can send the pdf file as an attachment to some other. It was working on pre ios 7 devices. After upgraded to ios 7 the attachment was missing when app presents the ios mail interface.

这里我用来设置mime类型的代码:

Here the code i used to set the mime type:

[mailComposer addAttachmentData:pdfData mimeType:@"application/octet-stream" fileName:fileName];

以上mime类型在pre ios 7上运行良好但在ios 7上它没有将我的文件作为一个附件。所以,我改变了这样的mime类型:

The above mime type works great on pre ios 7 but on ios 7 it was not taking my file as an attachment. So, i changed the mime type like this:

[mailComposer addAttachmentData:pdfData mimeType:@"application/pdf" fileName:fileName];

它在ios 7和pre ios 7设备上工作正常,但问题是,在iPad上如果是附加的pdf文件有单页,然后它被视为内嵌图像而不是附件。这种情况在iPad上的iPhone上发生就好了。此外,如果我将该邮件发送给某个人,在收件人方面,当他们在iphone或ipad上打开该邮件时,它也会显示为内嵌图像。因为当他们点击它时它允许两个选项1.保存图像2.取消。此问题不是关于ios 7 ipad设备,这是在ios 5,ios 6,ios 6.1和ios 7下运行的所有ipad设备上发生的。任何想法如何解决它?我应该使用什么mime类型来解决它?。

It was working fine on ios 7 and pre ios 7 devices but the problem was,On iPad if the attached pdf file has single page then it treated as inline image instead of an attachment. This is happening onnly on iPad on iPhone its fine. Also if i send that mail to some one, On the recipient side also it shows like an inline image when they open that mail on iphone or ipad. since when they tap it it allows two option 1. save image 2. cancel. Also this issue not about ios 7 ipad devices this is happening on all ipad devices which was running under ios 5, ios 6, ios 6.1 and ios 7. Any idea how to resolve it?. What mime type should i use for this to resolve it?.

注意: -
了解更多信息请查看附带的截图

Note:- for more info please check the attached screenshot

-loganathan

-loganathan

推荐答案

我对单页PDF有同样的问题。只需将mimeType更改为 text / pdf ,而不是 application / pdf ,它就可以了。无需进一步更改。

I have same problem with single page PDF. Just change mimeType to text/pdf instead of application/pdf and it's works.No further change required.

[objMailComposer addAttachmentData:myData mimeType:@"text/pdf" fileName:@"myapp.pdf"];

这篇关于使用我自己的应用程序通过电子邮件将单页pdf文件作为附件从iPad发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆