Font in merged field changed

Hello. We had purchased pdf.kit for Net and I had setup the merging of the fields in existing PDF. In that PDF all those fields are set to "Cambria Bold", size 12 (all other text is Time New Roman). However - after filling out the fields with the help of Aspose - for example

forms.FillField("TradeName", Me.txtFacTrade.Text)

- when I preview the PDF document - it changed the filled-in fields to different font - looks like Arial. Is there some limitation on which Fonts I can use? I'd like all those filled fields to be Bold. Please advise!

Hi Alla,

Thank you very much for considering Aspose.

Can you please share the problematic PDF along with the code snippet you’re using at your end? We’ll test the issue at our end and update you accordingly.

We’re sorry for the inconvenience.
Regards,

Sorry - I can't give you the PDF because of the sensitive nature of its content. It did happen to all 12 PDF files that I have - so I don't think it's pdf specific. I experimented with other fonts and looks like the form fields would retain only few fonts - Helvetica, Times and Courier. If I set the fields properties to any other fonts - it will auto-convert those to Helvetica after using FillFields. I'm pretty sure that you'd be able to duplicate the problem in any of your PDF. It looks like pdf.kit supports only few fonts, correct? The code I used is from your posted examples - pretty strait forward, nothing special.

inputFile = inputFilePath & "fileName.pdf"

Dim forms As Form = New Form(inputFile, FilePath1)

Try

forms.FillField("ResPrintName", ResidentName)

forms.FillField("RespPartyPrintName", Me.RespPartyNameTextBox.Text)

forms.FillField("AdmRepPrintName", Me.BC_AdmRepPrintNameTextBox.Text)

forms.FlattenAllFields()

forms.Save()

' MessageBox.Show("Demo Fill Fields run successfully!")

Catch e1 As Exception

MessageBox.Show("Error Messages:" + System.Environment.NewLine() + e1.ToString)

End Try

Hi Alla,

We’ll test the issue at our end and update you accordingly.

We’re sorry for the inconvenience.
Regards,

Hi Alla,

I have tested the issue at my end and I can see a slight difference, but I don’t think that the font is changed after filling the field using Aspose.Pdf.Kit. If you notice both the images (before filling and after filling), you’ll see that the characters in the output file are a little compressed but the font is same. Do you see the same issue at your end?

If it is different then please create and share a sample PDF file (without any sensitive data) that can reproduce the issue at our end. It is very important for our team to reproduce the issue at our end, in order to resolve it.

We appreciate your patience and cooperation.
Regards,

Thank you. Interesting that when I created new PDF file - it saved the formatting to Cambria and I got the same results that you had. In the existing PDF that I’m working with - it shows and prints Helvetica after merging - not even close to Cambria, but if I press on the merged field - it shows Cambria briefly on the screen, but still prints Helvetica. Looks like the issue is file-specific. I’ll try to get you a copy of the file without sensitive materials. Thank you for your help!

Here are 2 files - prior to merge and after. I filled out only 2 fields. Thanks!

Hi Alla,

Thank you very much for sharing the sample files.

I have reproduced the problem at my end and logged it as PDFKITNET-13389 in our issue tracking system. Our team will look into this matter and you’ll be updated via this forum thread once the issue is resolved.

We’re sorry for the inconvenience.
Regards,

The issues you have found earlier (filed as 13389) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.