Set new font properties

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v12)  /  Re: Set new font properties

DynamicPDF CoreSuite for .NET (v12) Forum

 Oct 12 2024 9:58 AM
I'm trying to set all the text fields font to new values.  The following codes doesn't throw any exceptions or errors, but the properties never change

string pdfFile = @"C:\Projects\Miscellaneous\Console\UnsecurePDF\UnsecurePDF\DA3161_Dec2023.pdf";
byte[] contents = File.ReadAllBytes(pdfFile);
MergeDocument document = new MergeDocument(contents);

for (int i = 0; i < document.Form.Fields.Count; i++)
{
    var formField = document.Form.Fields[i];
    var fieldName = formField.Name;            
    document.Form.Fields[i].Font = ceTe.DynamicPDF.Text.TimesRoman.TimesRoman;
    float fontSize = 8.00f;
    document.Form.Fields[i].FontSize = fontSize;
}
document.Draw(pdfFile);
 Oct 13 2024 9:02 PM

All times are US Eastern Standard time. The time now is 1:54 PM.