Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are doing something very wrong in your initial part of your code... I don't even want to go there, but let me break down a few things:</p> <p>1) <code>UIGraphicsBeginPDFContextToData</code> second parameter is a <code>CGRect</code>. </p> <p>2) From what I've understood, you want a very specific rectangle of what's showing on your screen and although its center is completely different from your view controller's view (you're trying to change both origin and size). So, why create a dependency on your view controller's view's bounds? (remember bounds and center always go hand in hand). </p> <p>3) So why not just get rid of the initial part of your code and do this:</p> <pre><code>CGRect fram = CGRectMake (537, 110, 404, 772); // A rectangle with no other dependency, since you want one very specific. NSMutableData *pdfData=[NSMutableData data]; UIGraphicsBeginPDFContextToData(pdfData, fram, nil); // Passing the newly created rectangle as the second parameter to the function. UIGraphicsBeginPDFPage(); CGContextRef pdfContext= UIGraphicsGetCurrentContext(); [tempV.layer renderInContext:pdfContext]; UIGraphicsEndPDFContext(); MFMailComposeViewController *mailComposer=[[[MFMailComposeViewController alloc]init] autorelease]; mailComposer.mailComposeDelegate=self; [mailComposer addAttachmentData: pdfData mimeType: @"application/pdf" fileName: @"Dudel creation.pdf"]; [pdfData writeToFile:@"Dudel creation.pdf" atomically:YES]; [self presentModalViewController: mailComposer animated: YES]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload