Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

HTML to PDF not converting Greek and Russian charactor properly

SA-6412

Summary




It was reported that when an end user uses the application to create a case for a consumer complaint, they, depending on certain conditions, fill up a survey. Once the survey is taken, it gets attached to the case and can be viewed as a pdf attachment. However, this survey is getting corrupted somehow and appears in the attachment with Unicode type characters.

Issue is applicable for the consumer country 'Greece'. For another country - Russia, the pdf form is blank.



Error Messages



No Error message

Steps to Reproduce



1. Write an activity to convert HTMLtoPDF
2. Pass html stream including sample Greece / Russia characters
3. View the generate pdf. The pdf file for the survey will show up with special characters similar to Unicode format (for Greece) and blank for Russia

Root Cause



The root cause of this problem is defect/misconfiguration in the PRPC operating environment. Following information was noted: 
1. The database character set was found to be - NLS_CHARACTERSET-AL32UTF8 and the Server side encoding was found to be UTF-8. 
2. No issues were found with HTMLtoPDF conversino. 

When you create a simple / standalone html file (outside PRPC) with the given sample Greece / Russian characters - the reported issue is observed. However upon including the relevant fonts, the issue was no longer noticed. 

Resolution



The solution was to add a step in the activity just before the call to the HTMLtoPdf activity to add the relevant fonts on the server. The following steps need to be followed:
  1. Before calling the HTMLtoPDF activity, set the parameters of the fontsDirectory path.
  2. PRPC should have access to the folder specified in the path .This is path to the server directory.
  3. For Unix and Windows env you can place fonts in java lib folder as specified in the example.
    Note: For 6.x the path specified should not have double slash.
  4. Keep the required fonts in the same folder.
  5. Need to add font-family in the css. All the fonts which you want to apply in your pdf should be placed in the same folder as specified in the activity.
  6. Below is an example of the HTML stream which has been tested locally to check how different fonts can be included in the same pdf. Fonts Included are English, Russian and Ukraine fonts.
    1. Input Stream
    2. Output PDF

Published January 31, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us