title: Print paper size and content inset
body: <p>I'm using following code to print HTML content containing text and images.</p>
  
  <pre><code>if (![UIPrintInteractionController isPrintingAvailable]) {
      UIAlertView *alertView = [[[UIAlertView alloc] 
          initWithTitle:NSLocalizedString(@"Printer Availability Error Title", @"")
          message:NSLocalizedString(@"Printer Availability Error Message", @"")
          delegate:nil
          cancelButtonTitle:NSLocalizedString(@"OK", @"OK")
          otherButtonTitles:nil] autorelease];
      [alertView show];
      return;
  }
  
  UIPrintInteractionController *pic = 
      [UIPrintInteractionController sharedPrintController];
  
  if(!pic) {
      NSLog(@"Couldn't get shared UIPrintInteractionController!");
      return;
  }
  
  pic.delegate = self;
  
  UIPrintInfo *printInfo = [UIPrintInfo printInfo];
  printInfo.outputType = UIPrintInfoOutputGeneral;
  printInfo.jobName = @"Sample";
  pic.printInfo = printInfo;
  
  NSString *htmlString = [self prepareHTMLText];
  UIMarkupTextPrintFormatter *htmlFormatter = 
      [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:htmlString];
  htmlFormatter.startPage = 0;
  // 1-inch margins on all sides
  htmlFormatter.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0); 
  // printed content should be 6-inches wide within those margins
  htmlFormatter.maximumContentWidth = 6 * 72.0;   
  pic.printFormatter = htmlFormatter;
  [htmlFormatter release];
  
  pic.showsPageRange = YES;
  
  void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
  ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) {
  
      if (!completed &amp;&amp; error) {
          NSLog(@"Printing could not complete because of error: %@", error);
      }
  };
  
  if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
      [pic presentFromBarButtonItem:self.myPrintBarButton 
          animated:YES 
          completionHandler:completionHandler];
  
  } else {
      [pic presentAnimated:YES completionHandler:completionHandler];
  }
  </code></pre>
  
  <p>See attached for results (the scaled down version may not be very clear, but, hopefully, you get the picture).</p>
  
  <p>Here are my questions:</p>
  
  <ol>
  <li><p>How is the print paper size determined by AirPrint? What if I want to specifically format and print data for A4 paper?</p></li>
  <li><p>The result of using the above code and printing using different simulated printers (Printer Simulator) is that, in all cases, I get a 1 inch margin on the top of first page, but not on consecutive pages. Why?</p></li>
  <li><p>The result of using the above code and printing using different simulated printers (Printer Simulator) is that, in some cases, the font style is lost. As a result, the content is shifted down. Why?</p></li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/IhI92.png" alt="Screen-shot"></p>