Stamping non-ASCII character does not work on Linux

Hey,

I would like to report an issue related to using the Aspose.PDF.Page’s AddStamp feature on Linux.

When adding a stamp which contains regular ASCII characters, everything works just fine.
But when I try to add a stamp using any special character, lets say ‘ű’ or a hebrew text, then the AddStamp function throws an exception.
This issue occurs only on Linux, on Windows it works fine.

Please see my attached sample project so that you can easily reproduce the error.

Aspose.PDF DLL version: 21.1.0

OS details:
Works on:
Windows 10 2004 OS build: 21301.1000

Does not work on:
Ubuntu 18.04 LTS with the latest patches
Ubuntu 20.04 LTS with the latest patches
CentOS 7

Thanks in advance,
Tamas Boldizsar

HebrewWatermarkOnLinux.zip (9.3 KB)

@tamas.boldizsar

Would you please share the complete exception message and stack trace information with us. We will further proceed to assist you accordingly.

@asad.ali

Of course, the exception message and stack trace is the following:

Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Aspose.Pdf.Text.Font…ctor(#=zWsmc8gQjGPLHH2zzZCyFBdM= #=z1tQh3Fg=)
at #=zrD4tI$NSsgP_Wp1tD0CJVdCSf8DHqC9xnvDtxoZWM7rU0fmnpqjErYw=.#=z6_Yr8nBn3vbWYGFEFsLo9HXglrgt(String #=z91LkzOQ=, Font #=z1tQh3Fg=, Font& #=z$hlEdOcZlN6C84cfIVO$elY=)
at Aspose.Pdf.Text.TextSegment.set_Text(String value)
at Aspose.Pdf.Text.TextFragment.set_Text(String value)
at Aspose.Pdf.TextStamp.Put(Page page)
at Aspose.Pdf.Page.AddStamp(Stamp stamp)

@tamas.boldizsar

The exception seems related to the missing font in the system. Would you please make sure that the font is present physically in the system and is installed correctly. Also, please try to do the following:

  1. Place msttcorefonts in a font folder inside the app
  2. Use FontRepository.Sources to add the font folder

Please let us know in case issue still persists.

@asad.ali

Thank you for your help! You were right, installing that font type solved the problem, it works now.