Questions tagged [uiprintpagerenderer]

A UIPrintPageRenderer object draws pages of content that are to be printed, with or without the assistance of print formatters. Available in iOS 4.2 and later . The issues related with coco touch's UIPrintPageRender should only use this tag.

A page renderer is an instance of a custom subclass of UIPrintPageRenderer. When you compose a print job using the shared instance of UIPrintInteractionController, you assign the page renderer to the printPageRenderer property of that instance.

UIPrintPageRenderer usually requires you to specify the number of pages of printable content by overriding numberOfPages. It also allows you to specify the heights of page headers and footers.

Source: UIPrintPageRenderer Class Reference

Related tag:

38 questions
1
vote
0 answers

Remaining page rect after UIViewPrintFormatter added to UIPrintPageRenderer

I'm using an instance of a UIPrintPageRenderer subclass to print many records, each of which is included by adding a UIViewPrintFormatter generated by a myTextView.viewPrintFormatter(). Some of the records occupy much less than a page, so I'd like…
Son of a Beach
  • 1,733
  • 1
  • 11
  • 29
1
vote
1 answer

How to set the Legal Page size for PDF created using UIPrintPageRenderer?

I am setting this: static CGFloat LegalPageWidth = 612.0; static CGFloat LegalPageHeight = 1008.0; as legal page size (i.e 8.5 x 14 inch) for PDF creation in UIPrintPageRenderer as "paperRect" but when I print the PDF its size is always A4 (i.e 612…
Shehroz
  • 13
  • 3
1
vote
0 answers

iOS print NSAttributedString with images as NSTextAttachement to PDF

I'm trying to convert the content of an UITextView to PDF. The UITextView uses an NSAttributedString that contains text and images. The images are instances of NSTextAttachment. I went through the UIPrintPageRenderer way passing the UIPrintFormatter…
1
vote
2 answers

Printing Contents of Multiple UIWebViews in one go

I have an iPad application that uses WebViews to display a list of URL's. I would like to be able to print all of the WebViews in one go, without prompting the user multiple times with the PrintInteractionController. The problem is that the…
1
vote
0 answers

UIPrintPageRenderer resize footerHeight

Is it possible to change the footerHeight of some pages in the UIPrintPageRender? Scenario: In our app we generate PDF files. An additional content came in that will be added in the footer for few pages NOT ALL. So what I did so far is to override…
SquareBox
  • 823
  • 1
  • 10
  • 22
1
vote
2 answers

UIPrintPageRenderer paper size not changing

I am trying to convert some HTML into a PDF document to save on my back end. However, I am unable to set the paper size of the print renderer. The paper size always remains A4 even when I change the 'paperRect' - I need the paper size to be A6. Any…
Tom Fox
  • 897
  • 3
  • 14
  • 34
1
vote
1 answer

Can't Get iOS Print Renderer to Draw Properly

OK. There seems to be a dearth of examples on this, and I am fairly stumped. I'm trying to make a custom print page renderer; the type that completely customizes the output, not one that uses an existing view. The really weird thing, is that I was…
Chris Marshall
  • 4,910
  • 8
  • 47
  • 72
1
vote
0 answers

iOS UIPrintPageRenderer prints last page for each page to be printed

I am in middle of developing an iOS app and I want to export certain reports in PDF format. So I am using webView to generate report and print webView to pdf. Here is my code: var renderer : UIPrintPageRenderer! override func viewWillAppear(_…
ujjwal
  • 428
  • 3
  • 16
1
vote
1 answer

UIPrintPageRenderer issue : generate pdf when loading multiple css files in HTML file

I'm using BNHtmlPdfKit to generate pdf file from html template. This lib has a UIWebView, it will load html string. Then it use UIPrintPageRenderer to generate pdf file. In HTML file, I have imported 2 css files like below :
ldt25290
  • 43
  • 2
  • 8
1
vote
1 answer

Is there an equivalent of "renderInContext" for UIPrintPageRenderer

You can call renderInContext on a layer. Is there something like that for UIPrintPageRenderer? I basically want to create a UIImage out of the first page of a PDF document of a UIPrintPageRenderer. I have the rest of the code except for the actual…
Zia
  • 14,622
  • 7
  • 40
  • 59
1
vote
1 answer

Draw string object with UIFont in custom UIPrintPageRenderer

I'm subclassing UIPrintPageRenderer to draw my own page for printing via AirPrint. I have a simple String object that I'd like to change the size of the font. Using the drawAtPoint withAttributes method, it string is drawn in the correct location,…
Austin
  • 291
  • 1
  • 4
  • 12
1
vote
1 answer

Change Printed Size of Image in iOS

In my app, I have the user make a coupon, preview it, and they have the option to print that coupon. Right now it simply crops down the screen to include the coupon part only and prints, but it is printing to a full-size 8.5 x 11 and uses lots of…
1
vote
1 answer

iOS printing interface causes transformation problems with a custom view

I'm struggling now quite a while with the printing interface of iOS. What I have is one view controller with a custom UIView that does its drawing in drawRect: An example how the drawing looks on an iPad is here (including some colored test…
1
vote
2 answers

Printing Pdf using AirPrint causes cut-off content

Here i am printing pdf with size 'pageSize = CGSizeMake(640, 832);'. this size is larget then A4 size page aspected. so i will cut-off some text(means it will not print whole page). while printing same pdf using MAC, it will print whole page with…
0
votes
1 answer

Creating PDF file with UIImage inserted to HTML code

This is a good documented example how to create a pdf file using html string. All works good excluding image I have UIImage object which I would like to use in HTML code when I preview it via WKWebView
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277