Hi,
i started working with AcroFields.
And i want to replace a "PdfTextField" with a drawn string from "gfx.DrawString" and use the "PdfTextField"s Font.
I found the "PdfTextField"s Font in the (formField.Elements["/DA"] as PdfString).Value as "0 g /TimesNewRoman,Bold 12 Tf".
How do i convert this to a XFont to use it in gfx.DrawString() function ? I need something like XFont.FromString()
Code:
//fontAsString = "0 g /TimesNewRoman,Bold 12 Tf"
String fontAsString = (formField.Elements["/DA"] as PdfString).Value;
XFont myXFont= XFont.FromString(fontAsString );
gfx.DrawString(text, myXFont, XBrushes.DarkSlateGray, xRect, format);
---------------------------------------------------------------------------------
I want to replace the field with a drawn string because when i fill the field like:
Code:
Fields[z].Value = new PdfString(value.ToString());
The value is not displayed with some PDF Viewer and also not in a windows folder as preview
Perhaps you have an idea why not ? I readed some posts telling about "/NeedAppearances" but that does not help.
---------------------------------------------------------------------------------
Thank you very much
Gioco