Enabling printing Chinese PDF files from QAD via LBOX

This page explains the steps required to enable LBOX printing Chinese PDF documents from Chinese QAD database. However, the same instruction can be used to enable printing documents in any other non English languages from corresponding QAD databases. Please note that one instance of LBOX can be setup to generate documents in multiple languages.  LBOX is a PDF and Excel document generator and distributor for QAD ERP.

It is assumed that you know what LBOX is and how it is working. Otherwise please visit this page for details.

I. Install Chinese Language on your Windows server, where LBOX is running.

  1. Go to Windows Server 2008 R2 Multilingual User Interface Language Packs. If your Windows server OS has different version, please Google “Download Chinese language pack for Windows 2003” and proceed.
  2. Select Chinese (Simplified) from the language dropdown box. Language will change on the page.
  3. Download Windows6.1-KB974587-x64-zh-cn.exe by clicking on the orange button. 
  4. After download starts, use the browser Back button to return to the English language page, and select Chinese (Traditional) from the drop down box.
  5. Download Windows6.1-KB974587-x64-zh-tw.exeby clicking on the orange button.
  6. After both downloads complete, run the installers one at a time. You need to run as Administrator.

II. Add encoding option to lbox.sh

In QAD server, where Chinese DB is running, add the following option in lbox.sh script:

$JAVA_HOME/bin/java -Dfile.encoding=GB2312 -jar LBOX2c.jar $nfile $section

Please note that -Dfile.encoding parameter should be set to the exact value you have in QAD Character Start-up script for Progress DB code page parameters. Usually this is GB2312 or CP936 for Chinese.


III. Run a sample report to text file

Create a section in LBOX.ini like shown below and print any report with Chinese text in it to this form.

saveDir     = D:\LBox\QADProdForms\CN\

Open the output text file on the file server console, where LBOX is running. Also print the same report to a PAGE output in QAD.

Compare both outputs, side by side, to see if Chinese characters are printed the same way. The outputs should be identical. If not, please check steps performed in #I and II above.

IV. Setup and try PDF form

Create a new section in LBOX.ini like shown below. Use alternative font settings in form sections of LBOX.ini file, located in $LBOX home directory on Windows file server.

saveDir     = D:\LBox\QADProdForms\CN\
template    = 32prn\pdf\ChineseIV.pdf
pdfparams   = -t 30 -l 30 -f 6 -s 8 -Charset GB2312 -an MingLiU -af 8

-an (Alternative Font. Use it for Chinese/Japanese/Korean fonts)
-af (Alternative font size)

The alternative font is used to print non-ASCII characters (characters greater than 255 in Unicode)
Now -n parameter can be used with font name, like this:
-n “MyFont.ttf” -an “chineseFont.ttf” -af 10
This way you can use Server Machine Fonts in addition to built in fonts.

Use the following settings

Language -Charset Parameter Value -an Font Name Value
Chinese GB2312 MingLiU
Microsoft JhengHei
Japanese SHIFT-JIS MS Mincho
MS Gothic
Korean ksc5601 GulimChe


You are not limited to only these fonts. You can go to Control Panel / Fonts and browse all existing ones by type. Use any Chinese fonts to generate Chinese PDF’s, Japanese fonts for Japanese PDF’s, etc.. Font control panel will show font type, if you select “detail view” when browsing fonts.

Print report to ChineseForm2 output and check resulting PDF file. Do not forget to restart LBOX service every time you make changes to the new form section in LBOX.ini file.

V. Verifying Chinese characters in PDF form

To be able to verify correctness of Chinese PDF form, you need to login to Windows Server Console, where LBOX is running. Install Adobe PDF Reader, if required. This machine has to have required Chinese fonts and you should be able to see proper Chinese text in Adobe PDF Reader window.

If you are using QAD’s .NET UI, login to Chinese QAD ERP from regular PC. Print the same report to “PAGE” in .NET UI and compare QAD’s PAGE output with PDF output generated by LBOX. They should be identical.

If you are using Character or GUI UI, you need to use PC with Chinese version of Windows or where Chinese language pack is installed. Similarly, print the report above to “PAGE” and compare QAD’s PAGE output with PDF output generated by LBOX. They should be identical.

If not getting the correct Chinese characters, please try another font and check all the settings above. If still having problems, please contact us.