Jump to content
Sign in to follow this  
Followers 0
srigger

Printing UIWebview content

3 posts in this topic

Recommended Posts

I can print the content of my uiwebview but it prints on two page, how can I scale it down to fit one page ?

 

My code:

 

@IBAction func printWebPage(sender: UIBarButtonItem) 

{

   let url = MainWebView.request?.URL

   let stringurl = url?.absoluteString

 

   let pic = UIPrintInteractionController.sharedPrintController()

   let printInfo : UIPrintInfo = UIPrintInfo(dictionary: nil)

 

   printInfo.outputType = UIPrintInfoOutputType.General

   printInfo.jobName = url  

 

   pic!.printInfo = printInfo

   pic!.printFormatter = MainWebView.viewPrintFormatter()

   pic!.showsPageRange = false

 

   pic!.presentAnimated(true, completionHandler: nil)

}

Share this post


Link to post
Share on other sites
Advertisement

Hi there,

I am also a newbie iOS developer and am not very sure whether this will be helpful or not but I read about this recently and think that this may work in your case. You can set the print preferences in UIPrintInfo and then there are a handful of settings on the UIPrintInteractionController that you can configure before displaying the printing UI. You can use printPaper UIPrintPaper: A simple type that describes the physical and printable size of a paper type; except for specialized applications, this will be handled for you by UIKit.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.

×