/ / PDFをメールで送信、共有、印刷する方法[終了]-ios、objective-c、pdf、共有

どのように電子メール、共有し、pdfを印刷するには? [閉鎖] - ios、objective-c、pdf、share

iOSアプリケーションを開発しています。iOSでのファイル操作の初心者です。各PDFファイルをメールで送信、共有、印刷したい。これらのPDFファイルはバンドルされていた。

View Controllerで、3つのボタンを作成しました:

  1. Eメール
  2. iBooks
  3. 印刷

これらのアクションを達成するにはどうすればよいですか?

回答:

回答№1は0

これはあなたにとって電子メールの助けになるかもしれません:

まず、インポート MessageUI.framework あなたのアプリケーションで。

また、デバイスまたはシミュレーターは、いずれかの電子メールアカウントで構成する必要があります。

次に、電子メールボタンのクリックイベントは次のようになります。

-(void)ClickOnEmailUs
{
MFMailComposeViewController *picker;
picker = [[MFMailComposeViewController alloc] init];
if(picker)
{
if ([MFMailComposeViewController canSendMail])
{
picker.mailComposeDelegate = self;
[picker setToRecipients:receipientsArrayOfStrings];
[picker setSubject:@"Your Subject"];
[picker setMessageBody:@"E-Mail Body" isHTML:YES];
[picker addAttachmentData:pdfData mimeType:@"application/pdf" fileName:@"file.pdf"];  // for adding attachment to the mail
[self.navigationController  presentModalViewController:picker animated:YES];
}
else
{
UIAlertView *noEmailAccountMsg = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Please configure your email account." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[noEmailAccountMsg show];
}
}
}