I need setting the font for PdfFormField too.

I try to set it when creating the field.

                field = PdfFormField.CreateTextField(writer, true, false, 1000);
                field.MKBackgroundColor = BaseColor.GRAY;
                field.FieldName = name;
                field.Flags = PdfAnnotation.FLAGS_PRINT;

                field.SetPage();
                PdfAppearance app = PdfAppearance.CreateAppearance(writer, 72, 
48);
                app.SetColorStroke(BaseColor.BLACK);
                app.SetColorFill(BaseColor.YELLOW);
                app.SetFontAndSize(bf, 12.0f);
                app.FillStroke();
                app.Fill();
                //ColumnText.ShowTextAligned(tp, Element.ALIGN_CENTER, new 
Phrase("SIGN
HERE"), 36, 24, 25);
                field.SetAppearance(PdfAnnotation.APPEARANCE_NORMAL, app);
                cell.CellEvent = new PDFSignatureFieldEvent(field);

Using the TextField doesn't seem to be an option for me because I follow an
example that uses digital signatures and field locking. I'm not sure if I
can even lock a TextField (can I?). And generally I will have to rediscover
many things. E.g., with PdfFormField I do:

        public void CellLayout(PdfPCell cell, Rectangle position,
PdfContentByte[] canvases)
        {
            PdfWriter writer = canvases[0].PdfWriter;
            field.SetPage();
            field.SetWidget(position, PdfAnnotation.HIGHLIGHT_INVERT);
            writer.AddAnnotation(field);
        }

To add it inside a table cell.
As far as I see, there is nothing similar in TextField.




--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Setting-the-font-of-form-text-fields-tp2967997p4658467.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to