Extended / international characters render as hash patterns when exported to PDF or Word


 Product:

 Export Utility for Lotus Notes / Domino > Export to PDF and MS-Word > Version 6.x

 Platform(s):

 All

 Edition(s):

 All

 Doc Number:

 1000060
Published 17-Oct-2013
Last Updated: 10-Sep-2019

 Problem

Extended / international characters contained within Notes documents render as hash patterns when exported to PDF or MS-Word.

 Solution

This problem can occur when the incorrect character set is selected in the export profile document and / or the rendered PDF file does not contain the required fonts to display the extended / international characters. See following image for an example:



To resolve the problem please refer to the following solutions. If none of the solutions works for you please contact us for further assistance.

Try Different Character Sets
Open the export profile document and select the 'Export Options -> Rendering Options' section. Recommended character sets are:
  • UTF-8 (8 bit encoding of ISO-10646)
  • UTF-16 (16 bit platform native byte order encoding of ISO-10646)

Try each of them and see which provides the best results.

Enable Automatic Font Detection
The 'Automatic Font Detection' feature of the Export Utility detects which fonts have been used in the Notes document being exported and ensure those fonts are embedded into the target PDF file thereby enabling the text to be correctly rendered.

To enable the Automatic Font Detection feature please follow these steps:
  • Open the Export Utility
  • Click on the 'Actions' option on the Lotus Notes menu bar.
  • Select 'Tools' and then 'PDF - Automatic Font Detection'

If the Export Utility is being accessed locally on the Notes client the following dialog box is displayed:


Select the 'Enable' option and click the 'Apply to Lotus Notes Client' button.

If the Export Utility is being access from a Domino server the following dialog box is displayed:


If the exports are only run from the Lotus Notes client select 'Enable' then click the 'Apply to Lotus Notes Client' button. If exports are run on the Domino server (for example scheduled exports) select 'Enable' then click the 'Apply to Domino Server' button.

Font Substitution
Sometimes the fonts specified by Lotus Notes / Domino when exporting documents do not contain the full range of characters that have been entered into the documents. For example Japanese characters may have been entered into a Lotus Notes document but when exported the font output by Notes is Sans-serif or Helvetica. These fonts do not contain Japanese characters and therefore result in '#' characters being output to the PDF file.

A feature of the Export Utility enables you to use font substitution whereby you can configure the export process to use an alternative / more suitable font instead of Sans-serif or Helvetica, or any other font you specify.

Setting Up Font Substitution
To do this follow these steps:
• Open Windows Explorer on your machine
• Navigate to the 'Export' folder which is located under your Lotus Notes data folder (example: c:\Program Files (x86)\IBM\Lotus\Notes\Data\Export, or c:\Lotus\Notes\Data\Export).
• In the export folder there should be a file called 'fopcfg.xml'
• Open this file using a standard text editor such as Notepad.
• Scroll down through the file and look for the section which begins with the '<renderers>' tag.
• Under this section there will be a sub-section that begins with the '<fonts>' tag.
• In this section is where you will put the font substitution settings.

The font substitution code will be in the following formats:

<!-- Use this format when the font file to use is a true-type font file containing a single font (TTF) -->
<font embed-url="[path to Windows font file to be used]" kerning="yes">
    <font-triplet name="[Source font to substitute]" style="normal" weight="normal"/>
</font>

<!-- Use this format when the font file to use is a true-type font class file containing multiple fonts (TTC) -->
<font embed-url="[path to Windows font class file to be used]" sub-font="[Sub-font name]" kerning="yes">
    <font-triplet name="[Source font to substitute]" style="normal" weight="normal"/>
</font>

Example: The following example shows the 'MS Gothic' font in the MSGothic.ttc font class file will be used in place of Arial, ArialtMT, Helvetica, Sans-serif, and Times-Roman fonts

<font embed-url="file:///C:/Windows/fonts/msgothic.ttc" sub-font="MS Gothic" kerning="yes">
    <font-triplet name="Arial" style="italic" weight="normal"/>
    <font-triplet name="Arial" style="italic" weight="bold"/>
    <font-triplet name="Arial" style="normal" weight="normal"/>
    <font-triplet name="Arial" style="normal" weight="bold"/>
    <font-triplet name="Arial" style="italic" weight="400"/>
    <font-triplet name="Arial" style="normal" weight="400"/>
    <font-triplet name="Arial" style="italic" weight="700"/>
    <font-triplet name="Arial" style="normal" weight="700"/>
    <font-triplet name="ArialMT" style="italic" weight="normal"/>
    <font-triplet name="ArialMT" style="italic" weight="bold"/>
    <font-triplet name="ArialMT" style="normal" weight="normal"/>
    <font-triplet name="ArialMT" style="normal" weight="bold"/>
    <font-triplet name="Helvetica" style="italic" weight="normal"/>
    <font-triplet name="Helvetica" style="italic" weight="bold"/>
    <font-triplet name="Helvetica" style="normal" weight="normal"/>
    <font-triplet name="Helvetica" style="normal" weight="bold"/>
    <font-triplet name="Helvetica" style="italic" weight="400"/>
    <font-triplet name="Helvetica" style="normal" weight="400"/>
    <font-triplet name="Helvetica" style="italic" weight="700"/>
    <font-triplet name="Helvetica" style="normal" weight="700"/>
    <font-triplet name="sans-serif" style="italic" weight="normal"/>
    <font-triplet name="sans-serif" style="italic" weight="bold"/>
    <font-triplet name="sans-serif" style="normal" weight="normal"/>
    <font-triplet name="sans-serif" style="normal" weight="bold"/>
    <font-triplet name="sans-serif" style="italic" weight="400"/>
    <font-triplet name="sans-serif" style="normal" weight="400"/>
    <font-triplet name="sans-serif" style="italic" weight="700"/>
    <font-triplet name="sans-serif" style="normal" weight="700"/>
    <font-triplet name="Times-Roman" style="italic" weight="normal"/>
    <font-triplet name="Times-Roman" style="italic" weight="bold"/>
    <font-triplet name="Times-Roman" style="normal" weight="normal"/>
    <font-triplet name="Times-Roman" style="normal" weight="bold"/>
</font>

Notes about the above settings:
• Embed-url: the filepath of the font file to be embedded in the generated PDF file.
• Sub-font: only required if the font file to be embedded is a true-type class file (ie. font file containing multiple fonts). This is the name of font within the class file to use.
• Each font to be substituted should be enclosed within a 'font-triplet' tag.
• Name: the name of the font to be replaced with the specified embedded font.
• Style: only substitute the font when the specified style matches. Valid styles are: normal, italic, oblique, backslant
• Weight: only substitute the font when the specified weight matches. Valid weights are: normal, bold, 100, 200, 300, 400, 500, 600, 700, 800, 900

If you're not sure which fonts you need to add substitutions for further information may be obtained from the Lotus Java console. The Java console can be opened by selecting 'Tools' from the Lotus Notes menu then select 'Show Java Debug Console'. If the console doesn't open restart Lotus Notes and try again. Run the export as normal then check the console. You should see something like the following entries logged to it:
org.apache.fop.events.LoggingEventListener.processEvent(LoggingEventListener.java:94) WARN: Glyph "?" (0x304c, gahiragana) not available in font "Times-Roman"
org.apache.fop.events.LoggingEventListener.processEvent(LoggingEventListener.java:94) WARN: Glyph "?" (0x304a, ohiragana) not available in font "Helvetica"

The above two lines indicate characters in the Notes document were not found in the Times-Roman or Helvetica fonts. You would therefore add substitution (font-triplet) entries for the above fonts.

Remember to save the fopcfg.xml file after updating it then run the export again.

It may take some trial and error to get the correct embedded-font and the correct font substitutions.

If you're still experiencing issues with fonts try adding the following lines to the above font substitution section:
    <font-triplet name="any" style="normal" weight="normal"/>
    <font-triplet name="any" style="normal" weight="bold"/>
    <font-triplet name="any" style="italic" weight="normal"/>
    <font-triplet name="any" style="italic" weight="bold"/>
    <font-triplet name="any" style="normal" weight="400"/>
    <font-triplet name="any" style="italic" weight="400"/>
    <font-triplet name="any" style="normal" weight="700"/>
    <font-triplet name="any" style="italic" weight="700"/>

If a matching font or font substitution cannot be found the conversion process falls back to using the 'any' font (Times-Roman by default). By adding the above lines this overrides the default Times-Roman font in favour of the specified font file.

A sample fopcfg.xml file has been attached to this support note for reference.

Japanese Fonts
One particular customer working with Japanese characters used the MS Mincho font instead of the MS Gothic font and therefore the first line of the fopcfg.xml file was changed to:

    <font embed-url="file:///C:/Windows/fonts/msmincho.ttc" sub-font="MS Mincho" kerning="yes">

In the first instance though you should normally use the MS Gothic font before trying other fonts.

The following is a list of additional font substitutions used by Japanese customers which enabled the export to work successfully.

    <font-triplet name="MS Pゴシック" style="normal" weight="normal"/>
    <font-triplet name="MS Pゴシック" style="normal" weight="bold"/>
    <font-triplet name="MS Pゴシック" style="italic" weight="normal"/>
    <font-triplet name="MS Pゴシック" style="italic" weight="bold"/>

Checking if the solution works
To check if the implemented solution works run your export as you normally do. If fixed the extended / international characters should render correctly. See the following example:



If you are unable to resolve the problem please contact us for further assistance.

Sample Fopcfg.xml File
Attached below is a sample fopcfg.xml file.

fopcfg.xmlfopcfg.xml

Additional Information
Additional information regarding the configuration of font settings can be found in the following support notes:
  • Setting Arial Font for PDF / MS-Word Exports ... Database 'AGECOM Support Notes', View '1. Search', Document 'Setting Arial Font for PDF / MS-Word Exports'
  • Improving Font Quality in PDF Files ... Database 'AGECOM Support Notes', View '1. Search', Document 'Improving Font Quality in PDF Files'



  Related Attachments


© 2019 AGE Computer Consultancy. All rights reserved.
Material may not be reproduced or distributed in any form without permission.