Free Support Forum - aspose.com

Change text FONT SIZE AND FONT NAME

HELLO

I downloaded the most recent .net version of aspose.pdf.kit. After I fill a form text box, the font of the text is really tiny. like this: cncnn

I want to change the font size of that text on the filled pdf form.

Is there a way to do that? You wrote some time ago that it was in development: this is what was said:

----------------------------------------------------------------------------------------

However, I agree with your judgement that the current version DOES NOT provide functions to set visual properties. Fortunately, these functions are undering devoloping and expected to be in the next release. For example, it is supposed to:

- set the border color, background color

- set the font, font size, text color

- set the border line style, line thickness, and dashed line style

I think these functions can fully satisfy your requirement. If you still have some other special requirements, please inform us for better supporting.

Best regards.


Luke Fu
Developer
Aspose Changsha Team
About Us
Contact Us

Hi Jaydean,

Thanks for considering out product.

The functions I metioned in the thread have been released for some days, please refer to our wiki :

http://www.aspose.com/Wiki/default.aspx/Aspose.Pdf.Kit/HowtoCreateandDecorateFormFieldsWithAPI.html

You should pay attentions to three APIs:

- public void DecorateField(String fieldName)

- public void DecorateField(FieldType fieldType)

- public void DecorateField( )

This is another example for decorating existing fields:

[C#]
//new a form editor
FormEditor form = new FormEditor("OnlineFilled.pdf","form\filled.pdf");
//new a facade object
FormFieldFacade facade = new FormFieldFacade();
//assign the facade to form editor
form.Facade = facade;
//set the backgroud color as Black like this:
facade.BackgroudColor=System.Drawing.Color.FromArgb(0, 0, 0);
//set the alignment as center like this:
facade.Alignment = FormFieldFacade.ALIGN_CENTER;
//only one field will be modified
form.DecorateField("fullName");
//clear the visual properties of facade like this:
form.ResetFacade();
//set the backgroud color as grey like this:
facade.BackgroudColor=System.Drawing.Color.FromArgb(0xcc, 0xcc, 0xcc);
//set the alignment as left like this:
facade.Alignment = FormFieldFacade.ALIGN_LEFT;
//modify another field visual attributes like this:
form.DecorateField("fullName");
//clear the visual properties of facade like this:
form.ResetFacade();
//close the document to validate the modification
form.Save();


[Visual Basic]
'new a form editor
Dim form As FormEditor = New FormEditor("OnlineFilled.pdf","form\filled.pdf")
'new a facade object
Dim facade As FormFieldFacade = New FormFieldFacade()
'assign the facade to form editor
form.Facade = facade
'set the backgroud color as Black like this:
facade.BackgroudColor=System.Drawing.Color.FromArgb(0, 0, 0)
'set the alignment as center like this:
facade.Alignment = FormFieldFacade.ALIGN_CENTER
'only one field will be modified
form.DecorateField("fullName")
'clear the visual properties of facade like this:
form.ResetFacade()
'set the backgroud color as grey like this:
facade.BackgroudColor=System.Drawing.Color.FromArgb(0xcc, 0xcc, 0xcc)
'set the alignment as left like this:
facade.Alignment = FormFieldFacade.ALIGN_LEFT
'modify another field visual attributes like this:
form.DecorateField("fullName")
'clear the visual properties of facade like this:
form.ResetFacade()
'close the document to validate the modification
form.Save()

Any other question is welcomed.

Best regards.