objective c - Multirow PDFAnnotationTextWidget in Cocoa -
i trying create editable pdf annotation in pdfkit multirow. user not need able create new rows, want text displayed on entire bounding box (i.e. on several lines).
however seems uses standard single line nstextfield when in editing mode. if access object change multiline seems pdfannotationtextwidget not expose object.
any ideas?
the example found example project pdfkit 2006, support single line annotations.
https://developer.apple.com/library/mac/samplecode/pdfannotationeditor/introduction/intro.html
if not possible, there way create custom pdfkit annotations, , in case, how?
it seems there no public method access nstextfield.
can access swizzling methods, did in this example (please note: code has lot of warnings because it's old)
in example can write multiple lines in nstextfield, when exit editing mode goes on single line: there reason why apple used single line text field widget annotations, afaik widget annotations in pdf supports single line, limitation on pdf annotations , not in apple sdk.
if save document after annotation added, can access other pdf editor...and in case see single line (that not nstextfield own implementation of pdf reader).
if want permit user write text on multiple lines, , visualize on pdf (but without possibility other pdf readers change annotations), have subclass pdfannotation
, create own class.
in case, have mystampannotation
file. can create similar class, inheriting pdfannotation
. when user clicks on annotation (in editing mode), add own textfield, write text directly on document using cgcontextshowtextatpoint
in drawwithbox:
method
Comments
Post a Comment