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

Free Support Forum - aspose.com

addFiled example and non-english characters

Hello.

I have used an example FieldAdding.java supplied with PDF.Kit distributive.

I have replaced string values with non-english text, and have no errors while running, but in resulting pdf-file i don't see any non-english characters.

Looking farther down the docs i have found no methods to set any Locale or something for the text field.

Is there any way to change this behaviour?

WBR, j2k6.

Hi Dim,

Thank you very much for considering Aspose.

Please share the code snippet (including the non-english text) along with the problematic PDF. We need to test the issue at our end.

We’re sorry for the inconvenience.
Regards,

Here comes the code snippet and attachments.

//open the document and create a FormEditor object

FormEditor formEditor = new FormEditor("c:\\fieldAdd.pdf", "c:\\added.pdf");
com.aspose.pdf.kit.License license = new com.aspose.pdf.kit.License();
license.setLicense(new FileInputStream(new File("c:\\lic.lic")));
//create a FormFieldFacade to specify visual attributes
FormFieldFacade facade = new FormFieldFacade();
formEditor.setFacade(facade);
//add a text field with blue dashed border, green background, and red inverse text
facade.setBorderColor(new java.awt.Color(0, 0, 255));
facade.setBorderStyle(FormFieldFacade.BDSTYLE_DASHED);
facade.setBorderWidth(FormFieldFacade.BDWIDTH_THICK);
facade.setBackgroudColor(new java.awt.Color(0, 255, 0));
facade.setAlignment(FormFieldFacade.ALIGN_CENTER);
facade.setFont(FontStyle.TimesRoman);

facade.setTextColor(new java.awt.Color(255, 0, 0));
facade.setFontSize(12);
formEditor.addField(FormEditor.FLDTYP_TXTFLD, "text1", "Русский текст. Russian text", 1, new Rectangle(215, 647, 200, 25));

//Close the document
formEditor.close();

Hi Dim,

I checked the PDF file at my end and found that the text is added successfully, but only visible when we select the field. I have also attached the snapshot. kindly confirm that this is the same problem you’re having at your end.

We’re looking forward to help you out.
Regards,

Well, i get some difference when open this document.

While russian text physically get in file, i can not see it even when focusing on form field.

See attachment for details. Hint signals that russian text is present in file.

Also, it seems to me that whichever font i'm trying to set (in code snippet - it is Times) - result have no difference - see screenshot - it really does not looks like Times.

WBR, j2k6.

Hi Dim,

Now, I can see the issue of the missing text.

Please make sure that you’re using the latest version of the component - Aspose.Pdf.Kit for Java 2.4.2. Also, please make sure you have appropriate fonts installed on your machine. If it still doesn’t resolve your issue, or you’re already using the latest version, then please share more details regarding your working environment i.e. Operating System, Culture Settings etc. In fact, in order to understand the issue and then resolve it, we need to reproduce the problem at our end to understand the cause of the problem. The related information shared by you will help us in this process.

We’re looking forward to help you out.
Regards,