title: How to export UIView to PDF file
body: <p>I implement exporting PDF feature in my application, content used to export is <code>UIView</code>. Now I have a list data and use for loop to load all objects, every object will be loaded in <code>UIView</code> and export a page. The output file should have multipage but it has only one first page.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>UIGraphicsBeginPDFContextToFile(path, CGRectZero, nil);
  _context = UIGraphicsGetCurrentContext();
  
  for (Entry *entry in listEntries) {
      [self loadEntry:entry.date];
  
      UIGraphicsBeginPDFPageWithInfo(CGRectMake(0.0f, -160.0f, 768.0f, 660.0f), nil);
      [self.layer renderInContext:_context];
      UIGraphicsEndPDFContext();
  }
  </code></pre>
  
  <p>Thanks in advance,</p>