c# - How do you change the icon size of a PDF sticky note placed via iTextSharp? -
i'm trying enlarge icon of pdf sticky note. here's image showing sticky icon i've stamped on first page of pdf context:
i under impression icon guided rectangle manipulated. here's code has not been effective yet:
using (pdfstamper stamp = new pdfstamper(reader, fs)) { pdfwriter attachment = stamp.writer; foreach (string file in files_to_attach) { pdffilespecification pdfattch = pdffilespecification.fileembedded(attachment, file, file, null); stamp.addfileattachment(file, pdfattch); } //create note first page rectangle rect = new rectangle(850, 850, 650, 650); pdfannotation annotation = pdfannotation.createtext(stamp.writer, rect, "title of note", "body text of note", false, "comment"); //enlarge sticky note icon pdfdictionary page = reader.getpagen(1); pdfarray annots = page.getasarray(pdfname.annots); pdfdictionary sticky = annots.getasdict(0); pdfarray stickyrect = sticky.getasarray(pdfname.rect); pdfrectangle stickyrectangle = new pdfrectangle( stickyrect.getasnumber(0).floatvalue - 50, stickyrect.getasnumber(1).floatvalue - 20, stickyrect.getasnumber(2).floatvalue, stickyrect.getasnumber(3).floatvalue - 30); sticky.put(pdfname.rect, stickyrectangle); //apply note first page stamp.addannotation(annotation, 1); stamp.close(); }
i thought change float values , change shape of icon far has not effected all. thank suggestions.
you can't. icon displayed "comment" annotation supplied viewer. rect property used define lower left corner of icon gets placed on page viewer. according pdf specification annotations type "text", "conforming readers shall provide predefined icon appearances @ least following standard names: comment, key, note, help, newparagraph, paragraph, insert.
you can, however, create own image, of size, , use appearance "stamp" annotation. can "comment" icon, bigger. end functioning in same way end user.
Comments
Post a Comment