Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3440164
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:23:58+00:00 2026-05-18T08:23:58+00:00

Hy! I had generate a PDF File on my iPhone App. Now I want

  • 0

Hy!

I had generate a PDF File on my iPhone App.
Now I want to send it via EMail – i use the MailViewController and have to add my attachment, but now the question…

Whick URL should I write when I only written the filename.pdf at the PDFContext?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:23:59+00:00Added an answer on May 18, 2026 at 8:23 am

    To send a pdf file that is included as a resource in your app:

    NSString *path = [[NSBundle mainBundle] pathForResource:@"filename" ofType:@"pdf"];
    

    To send a pdf file that you’ve GENERATED in your app:

    1. write to disk.
    2. use the path to attach it to the email.

    For a detailed discussion of temp directories, read this:
    http://cocoawithlove.com/2009/07/temporary-files-and-folders-in-cocoa.html
    But in short:

    NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"filename.pdf"];
    if ([fileData writeToFile:filePath atomically:YES]) {
        NSLog(@"success!");
    } else {
        NSLog(@"fail");
    }
    

    the path you use to create a PDFContext should be in either the documents directory, or the temp directory, depending on how long you want the file to persist. “filename.pdf” is not a valid path to be creating a pdf context with.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate PDF in rails application. I had saw different options for
I want to generate crystal report in pdf format. I had done the same
I have a ASP.NET app that at one point generates a PDF file and
Hi, I had Generate custom layouts in my screen, i want change color or
I am using html2pdf library in order to generate pdf from html file. I
I have a process that's going to initially generate 3-4 million PDF files, and
We have an ASP.NET application that users use to generate certain reports. So far
I have a group of PDFs and i want a batch file to move
I have a large C codebase for which I had to generate Call graphs.
I have an app that's basically a fancy PDF reader. I download a PDF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.