uiwebview - IOS print pdf in A4 Format -
i'm trying print pdf uiwebview
, output pdf not fill a4 format. why? how resolve that?
any appreciated =)
if found solution avoid printing form iuwebview
. directly download pdf in nsdata format.
_data represente nsdata download request.
if (_data) { uiprintinteractioncontroller *printcontroller = [uiprintinteractioncontroller sharedprintcontroller]; printcontroller.delegate = self; uiprintinfo *printinfo = [uiprintinfo printinfo]; printinfo.outputtype = uiprintinfooutputgeneral; //printinfo.jobname = [path lastpathcomponent]; printinfo.duplex = uiprintinfoduplexlongedge; printcontroller.printinfo = printinfo; printcontroller.showspagerange = yes; printcontroller.printingitem = _data; void (^completionhandler)(uiprintinteractioncontroller *, bool, nserror *) = ^(uiprintinteractioncontroller *printcontroller, bool completed, nserror *error) { if (!completed && error) { nslog(@"failed! due error in domain %@ error code %lu", error.domain, (long)error.code); } }; [printcontroller presentanimated:yes completionhandler:completionhandler]; }
Comments
Post a Comment