I have the following code:
..
com.aspose.pdf.TextStamp textStampCompany = new com.aspose.pdf.TextStamp("test");
textStampCompany.setValue(companyName);
..
pdfDocument1.getPages().get_Item(1).addStamp(textStampCompany);
..
where companyName is "Société Générale".
Everything works lovely on my windows machine, but when I transfer the code to a linux server it fails with the following error:
class com.aspose.ms.System.e: Key cannot be null
Parameter name: key
com.aspose.ms.System.a.h.get_Item(Unknown Source)
com.aspose.pdf.a.c.e.b.f$a.a(Unknown Source)
com.aspose.pdf.a.f.a.a(Unknown Source)
aspose.pdf.html.HtmlWeb.getStandardFontForCodeRange(Unknown Source)
aspose.pdf.html.HtmlWeb.areAllCharsPresent_CheckExistingOrReplaceFont(Unknown Source)
com.aspose.pdf.TextSegment.setText(Unknown Source)
com.aspose.pdf.TextFragment.setText(Unknown Source)
com.aspose.pdf.TextStamp.put(Unknown Source)
com.aspose.pdf.Page.addStamp(Unknown Source)
Which I assume is linked to the extended chars from the utf-8 company name.
Is there anything I can do fix the problem?
*************
Fixed:
*************
not really sure why, but setting the local font path to where I've copied all my windows fonts seems to have fixed my problem;
com.aspose.pdf.Document.setLocalFontPath("Fonts");