objective c - How to have a NSTextView with a different font size just for printing? -
i have nstextview shows when text set @ least 16 in size, big printing. how have nstextview different font size printing ? have digged nsprintinfo got no result far. thanks
here's example:
// create text view printing var printtextview = nstextview(frame: nsmakerect(0, 0, 528, 688)) // a4 // add modified version of attributed string view printtextview.textstorage!.mutablestring.appendstring(myattributedstringwithadjustedsize) // printing infos let sharedinfo = nsprintinfo.sharedprintinfo() let shareddict = sharedinfo.dictionary() let printinfodict = nsmutabledictionary(dictionary: shareddict) printinfodict.setobject(nsprintspooljob, forkey: nsprintjobdisposition) let printinfo = nsprintinfo(dictionary: printinfodict) // set preferences printinfo.horizontallycentered = true printinfo.verticallycentered = false printinfo.scalingfactor = 0.8 // print custom text view let op = nsprintoperation(view: printtextview, printinfo: printinfo) op.runoperation()
Comments
Post a Comment