Product Version: 18.104.22.168584
Please give a brief summary of your issue:
When foreign characters are used in field values, RefreshFieldAppearances hangs (doesn’t return or throw an exception)
Please describe your issue and provide steps to reproduce it:
- Using a fillable PDF, set value of a field to something including some foreign characters such as “中国äč”
- Then call doc.RefreshFieldAppearances()
- There are two outcomes, on my Windows machine this completes as you would expect with the characters properly appearing in the field. When the same application is deployed into an Azure Web App, it never returns and does not throw an exception, it just hangs there.
I’m assuming it has to do with the installed fonts on the host, but it is unclear how to work around this issue with the PDFTron library.
Please provide a link to a minimal sample where the issue is reproducible:
Welcome to the community!
Since the code is working locally, and the issue is Azure specific, its possible your instance is lacking fonts with enough coverage for conversion. The following will help your server have minimal Unicode coverage.
- Download the web fonts package from here: http://pdftron.s3.amazonaws.com/downloads/SelfServeWebFontsV2.zip
- Extract the zip somewhere that the code can access (make sure the permissions are correct)
- Add the following line of code after PDFNet.Initialize().
Please note that due to some sandboxing Windows does, our .NET framework SDK is not compatible with all Azure options. While probably unrelated to this particular issue, you may want to switch to our .NET Core SDK. See the last Changed Behavior entry here.
Finally, GDI+ may be missing/blocked by your OS: https://www.pdftron.com/documentation/windows/faq/dotnet-fileload-exception/#unable-to-load-dll-pdfnetdll-or-one-of-its-dependencies:-a-dynamic-link-library-dll-initialization-routine-failed-0x8007045a