Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
EdwinWong Absent Member.
Absent Member.
472 views

Creating PDF on UTF-8

I run the following program in COBOL_CHARACTER_SET 950 environment is OK but in COBOL_CHARACTER_SET UTF-8 return error 48,02.

 

       identification division.
       program-id. TESTPDF.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SPECIAL-NAMES.
       input-output section.
       file-control.
           select file-output
           ASSIGN TO ws-printer
           organization is LINE SEQUENTIAL
           FILE STATUS IS FILE-STATUS.
   
       data division.
       file section.             
       FD file-output.
       01 file-output-rec.
           05 file-record           PIC  X(132).
   
   
       working-storage section.
       77 FILE-STATUS          pic XX.
   
       01 WS-PRINTER           PIC X(51) VALUE spaces.
   
       procedure division.
       main-logic.

           move "-p pdf c:\test\PRINT1.PDF" to ws-printer

           open output file-output.
           move "Test Print" to file-record
                   write file-output-rec
           close file-output.

           stop run.

0 Likes
2 Replies
Micro Focus Expert
Micro Focus Expert

RE: Creating PDF on UTF-8

When attempting to use UTF-8, you need to specify a font, a truetype font.
The configuration file when using a TrueType .ttf file should look something like this:
cobol-character-set utf-8
pdf_font_type truetype
pdf_font_truetype_ttf cambriab.ttf
When using a TrueType .ttc file the configuration should look something like this:
cobol-character-set utf-8
pdf_font_type truetype
pdf_font_truetype_ttc cambria.ttc
pdf_font_truetype_ttc_index 1
0 Likes
EdwinWong Absent Member.
Absent Member.

RE: Creating PDF on UTF-8

Same error occurs.

Never mind. We already have export report to PDF function using pdf printer driver. We are just looking for simpliest way to do it.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.