Free Support Forum - aspose.com

Signature Fonts

I am evaluating Aspose.Word and Aspose.PDF and am having a problem when setting a fontname to a customized signature font. The way the font works is the document contains the letter “S” where you want the signature. If you chantge the font of the “S” to one of the customized signature fonts the signature replaces the “S”.
I use Aspose.Word to modify a template word document. The Word document has the signature but when I use Aspose.PDF to convert the word document to PDF the Siganture text show the “S”.

I have attached the code to produce the final word document and convert it to PDF.

Thanks in advance for your assistance.

Thought you might want the word documents also. Attached are the template and final documents.

Final document attached

Dear vaughnis,

Thank you for considering Aspose.

I can’t understand your requirement exactly. Can you please elaborate it or also attach the pdf file to explain the problem?

Custom fonts is not supported directly. You need to install the font into the system if you want to use a custom font.

The sinature font is loaded on the PC. These fonts are actual signatures, the way they work is you place a 'S' in the document and then change the font of the 'S' to the font name (in our case the font name is the name of the person whose signature you want on the document). I sent a followup post that has the word document attached. Near the bottom of the 1st page you will se a signature for J Laurence Johnston. On the template document this is a merge field. In the code I set the font to the session variable 'FontName' which is ' J L Johnston PDF' and write an 'S' to the merge field. In the word document it puts the signature. I then convert the word document to PDF but the signature on the PDF document is an 'S'.
I do not have a copy of the PDF to send, sorry. I will try to get it to save to a file and will send it if I am able to get it.

I hope this clearifys things somewhat.

Thanks
Russ

Attached is the PDF file. Notice the ‘S’ near the bottom of page 1. Where as the word document has the signature.

Dear vaughnis,

Thank you for considering Aspose.

The Word document can display the signature in my machine. Should this because I have not the font installed? It that a truetype font? Can you please send the font to me and let me test it?

I have attached the example font that comes with the signature fonts we orderd. In the word document I sent you if you will highlight the S and change its font to famous (after putting it in your fonys directory) it should cange the S to a signature.

Dear vaughnis,

Thank you for considering Aspose.

I have installed the font and then set the font of “S” to “Famous” in the Word document, then the signature in the pdf is correct. Please make sure you have installed the font (simply copy the font into the system’s fonts folder).

Tommy

I had been trying a different font than the one I sent you (I am not allowed to send the font of our Judges out). Upon getting you response that it worked for you I decided to try the ‘famous’ font. Using the famous font I still get the ‘S’ on the pdf. I am unsure as to the word document (as I am n ow getting an error when I attempt to save it) but I suspect it would work. I have attached a word document containing the error I am getting and the code that runs to create the word document and convert it to pdf.

Thanks
Russ

Dear Russ,

Thank you for considering Aspose.

Please test the font directly using the following XML and see if it works:

<?xml version="1.0" encoding="utf-8" ?>



S



Tommy

I am sorry but I am fairly new to web development and xml (long time vb client server developer). How exactly do I test the XML text you sent?

Also, any idea on the error I’m getting on this line of code:
doc.Save(sSavePath & “” & sFileName & “.doc”)
The error is as follows:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

I swear this line of code was working at one time.

Thanks
Russ

This is what I did to test the xml you sent. Let me know if I should have done it some other way. I created a text file that contained the xml you sent me (name FontTest.xml). I then ran the following code:

Dim xmlDoc As XmlDocument = New XmlDocument
xmlDoc.Load("C:\inetpub\wwwroot\cmsefiling\documents\fonttest.xml")
Dim pdf As Aspose.Pdf.Pdf = New Aspose.Pdf.Pdf
pdf.IsImagesInXmlDeleteNeeded = True
pdf.BindXML(xmlDoc, Nothing)
pdf.Save(sFileName & ".pdf")
pdf.Save("Aspose.Word.Demos.pdf", Aspose.Pdf.SaveType.OpenInBrowser, Me.Response)

The pdf file if produced is attached. It contains only the 'S'.

Dear Russ,

Thank you for considering Aspose.

The exception in “doc.Save(sSavePath & “” & sFileName & “.doc”)” is thrown by Aspose.Word. Please post this question at Aspose.Word forum.

The PDF file contains only “S” means Aspose.Pdf can’t find the font “Famous” in your system. Please make sure this font is installed in you %system%\fonts.

I do have the Famous font on my PC. But just to verify I created a word document using Word that contains nothing but an ‘S’. Chaged the font to Famous and received the signature. I then ran the code to open the word document and convert it to pdf. The pdf file contained the ‘S’.

Dear vaughnis,

Thank you for considering Aspose.

Can you please send the XML generated by Aspose.Word to me?

BTW, which version of Aspose.Pdf and Aspose.Word do you use?

I am runnign version 1.1.4322 of Aspose.PDF and Aspose.Word.
How do I get the XML generated by Aspose.Word?

Dear vaughnis,

Thank you for considering Aspose.

1.1.4322 should not be the version of Aspose.Pdf and Aspose.Word since we do not use that version number. Please check the latest version at Downloads.
You should use the Save method of Aspose.Word.Document to get the XML. Please refer to the API documentation and online demos of Aspose.Word.

Sorry I copied down the runtime version from the properties information. Here are the correct version numbers:
Aspose.PDF 2.1.13
Aspose.Word 2.4.1
I will work on the XML generated by Asose.Word today.

Attached is the xml file generated by Aspose.Word