We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to fill pdf from and select custom font

I’d like to use a custom font that i have installed on my system, is it possible?
Here is my code:

        string basePath = @"C:\c_project\pdfTest\";
        // Load PDF form contents
        FileStream fs = new FileStream(basePath + "result_bold.pdf", FileMode.Open, FileAccess.ReadWrite);
        // Instantiate Document instance with stream holding form file
        Aspose.Pdf.Document pdfDocument = new Aspose.Pdf.Document(fs);
        var f = pdfDocument.FontUtilities;
        
        // Get referecne of particuarl TextBoxField
        TextBoxField txtFld = pdfDocument.Form["t.z"] as TextBoxField;
        
        txtFld.Value = "בדיקה"; // Hebrew  text
        
        basePath = basePath + "Hebrew TextFilling_out.pdf";
        // Save updated document
        pdfDocument.Save(basePath);

How to update this code to use a custom font to write text in Hebrew lang?
thank you

@tomas2457

You can please try to use TextBoxField.DefaultAppearance.FontName property in order to set font for it and let us know in case you still face any issues. Please also share your sample PDF with us in case you are unable to achieve what you require.