How to config fonts for Xpdf tools Linux


Xpdf is a free and open-source PDF viewer for operating systems supported by the Qt toolkit.

Website: xpdfreader.com

Step 1: make folder fonts eg: /root/xpdf-tools-linux-4.00/fonts

Then change dir:

cd /root/xpdf-tools-linux-4.00/fonts

Step 2: download all fonts:

wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-t1fonts.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-arabic.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-chinese-simplified.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-chinese-traditional.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-cyrillic.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-greek.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-hebrew.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-japanese.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-korean.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-latin2.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-thai.tar.gz
wget https://xpdfreader-dl.s3.amazonaws.com/xpdf-turkish.tar.gz

Step 3: extract files

tar -xvf xpdf-chinese-simplified.tar.gz
tar -xvf xpdf-arabic.tar.gz;tar -xvf xpdf-chinese-traditional.tar.gz;tar -xvf xpdf-cyrillic.tar.gz;tar -xvf  xpdf-greek.tar.gz;tar -xvf xpdf-hebrew.tar.gz;tar -xvf xpdf-japanese.tar.gz;tar -xvf xpdf-korean.tar.gz;tar -xvf xpdf-latin2.tar.gz;tar -xvf xpdf-t1fonts.tar.gz;tar -xvf xpdf-thai.tar.gz;tar -xvf xpdf-turkish.tar.gz

Result:

...
xpdf-arabic/README
xpdf-arabic/add-to-xpdfrc
xpdf-arabic/ISO-8859-6.unicodeMap
xpdf-chinese-traditional/
xpdf-chinese-traditional/Adobe-CNS1.cidToUnicode
xpdf-chinese-traditional/Big5.unicodeMap
xpdf-chinese-traditional/CMap/
xpdf-chinese-traditional/CMap/UniCNS-UCS2-H
xpdf-chinese-traditional/CMap/UniCNS-UTF8-H
xpdf-chinese-traditional/CMap/HKscs-B5-V
xpdf-chinese-traditional/CMap/Adobe-CNS1-6
xpdf-chinese-traditional/CMap/HKm314-B5-H
xpdf-chinese-traditional/CMap/HKgccs-B5-V
xpdf-chinese-traditional/CMap/Adobe-CNS1-1
xpdf-chinese-traditional/CMap/HKdla-B5-V
xpdf-chinese-traditional/CMap/HKm471-B5-V
xpdf-chinese-traditional/CMap/CNS2-V
xpdf-chinese-traditional/CMap/HKm471-B5-H
xpdf-chinese-traditional/CMap/ETen-B5-V
xpdf-chinese-traditional/CMap/UniCNS-UTF32-H
xpdf-chinese-traditional/CMap/Adobe-CNS1-2
xpdf-chinese-traditional/CMap/ETHK-B5-H
xpdf-chinese-traditional/CMap/B5pc-H
xpdf-chinese-traditional/CMap/HKscs-B5-H
xpdf-chinese-traditional/CMap/Adobe-CNS1-5
xpdf-chinese-traditional/CMap/ETenms-B5-V
xpdf-chinese-traditional/CMap/B5pc-V
xpdf-chinese-traditional/CMap/UniCNS-UCS2-V
xpdf-chinese-traditional/CMap/Adobe-CNS1-3
xpdf-chinese-traditional/CMap/B5-H
xpdf-chinese-traditional/CMap/ETenms-B5-H
xpdf-chinese-traditional/CMap/CNS1-H
xpdf-chinese-traditional/CMap/HKdla-B5-H
xpdf-chinese-traditional/CMap/CNS1-V
xpdf-chinese-traditional/CMap/Adobe-CNS1-0
xpdf-chinese-traditional/CMap/UniCNS-UTF32-V
xpdf-chinese-traditional/CMap/B5-V
xpdf-chinese-traditional/CMap/HKdlb-B5-V
xpdf-chinese-traditional/CMap/UniCNS-UTF8-V
xpdf-chinese-traditional/CMap/B5pc-UCS2
xpdf-chinese-traditional/CMap/HKgccs-B5-H
xpdf-chinese-traditional/CMap/HKm314-B5-V
xpdf-chinese-traditional/CMap/UniCNS-UTF16-V
xpdf-chinese-traditional/CMap/B5pc-UCS2C
xpdf-chinese-traditional/CMap/ETen-B5-H
xpdf-chinese-traditional/CMap/UniCNS-UTF16-H
xpdf-chinese-traditional/CMap/Adobe-CNS1-UCS2
xpdf-chinese-traditional/CMap/CNS2-H
xpdf-chinese-traditional/CMap/ETHK-B5-V
xpdf-chinese-traditional/CMap/ETen-B5-UCS2
xpdf-chinese-traditional/CMap/HKdlb-B5-H
xpdf-chinese-traditional/CMap/CNS-EUC-V
xpdf-chinese-traditional/CMap/CNS-EUC-H
xpdf-chinese-traditional/CMap/Adobe-CNS1-4
xpdf-chinese-traditional/Big5ascii.unicodeMap
xpdf-chinese-traditional/README
xpdf-chinese-traditional/add-to-xpdfrc
xpdf-cyrillic/
xpdf-cyrillic/README
xpdf-cyrillic/add-to-xpdfrc
xpdf-cyrillic/KOI8-R.unicodeMap
xpdf-cyrillic/Bulgarian.nameToUnicode
xpdf-greek/
xpdf-greek/README
xpdf-greek/add-to-xpdfrc
xpdf-greek/ISO-8859-7.unicodeMap
xpdf-greek/Greek.nameToUnicode
xpdf-hebrew/
xpdf-hebrew/README
xpdf-hebrew/add-to-xpdfrc
xpdf-hebrew/Windows-1255.unicodeMap
xpdf-hebrew/ISO-8859-8.unicodeMap
xpdf-japanese/
xpdf-japanese/ISO-2022-JP.unicodeMap
xpdf-japanese/Shift-JIS.unicodeMap
xpdf-japanese/CMap/
xpdf-japanese/CMap/78-EUC-V
xpdf-japanese/CMap/90ms-RKSJ-V
xpdf-japanese/CMap/83pv-RKSJ-H
xpdf-japanese/CMap/UniJIS-UTF32-H
xpdf-japanese/CMap/UniJISX02132004-UTF32-V
xpdf-japanese/CMap/Adobe-Japan1-3
xpdf-japanese/CMap/90pv-RKSJ-H
xpdf-japanese/CMap/UniJIS-UCS2-V
xpdf-japanese/CMap/UniJISPro-UTF8-V
xpdf-japanese/CMap/90msp-RKSJ-H
xpdf-japanese/CMap/78ms-RKSJ-H
xpdf-japanese/CMap/UniJIS2004-UTF8-V
xpdf-japanese/CMap/Add-RKSJ-H
xpdf-japanese/CMap/UniJISX0213-UTF32-V
xpdf-japanese/CMap/Ext-RKSJ-V
xpdf-japanese/CMap/UniJIS2004-UTF32-V
xpdf-japanese/CMap/UniJIS2004-UTF8-H
xpdf-japanese/CMap/Ext-H
xpdf-japanese/CMap/Ext-V
xpdf-japanese/CMap/Katakana
xpdf-japanese/CMap/UniJIS-UTF8-V
xpdf-japanese/CMap/Hankaku
xpdf-japanese/CMap/UniJISX02132004-UTF32-H
xpdf-japanese/CMap/90msp-RKSJ-V
xpdf-japanese/CMap/UniJISX0213-UTF32-H
xpdf-japanese/CMap/UniJISPro-UCS2-V
xpdf-japanese/CMap/Adobe-Japan1-6
xpdf-japanese/CMap/V
xpdf-japanese/CMap/EUC-V
xpdf-japanese/CMap/78-EUC-H
xpdf-japanese/CMap/90ms-RKSJ-UCS2
xpdf-japanese/CMap/Adobe-Japan1-2
xpdf-japanese/CMap/UniJIS2004-UTF16-V
xpdf-japanese/CMap/UniJISPro-UCS2-HW-V
xpdf-japanese/CMap/Adobe-Japan1-0
xpdf-japanese/CMap/Roman
xpdf-japanese/CMap/UniJIS-UTF32-V
xpdf-japanese/CMap/UniJIS-UTF16-V
xpdf-japanese/CMap/90pv-RKSJ-UCS2
xpdf-japanese/CMap/Add-H
xpdf-japanese/CMap/90pv-RKSJ-UCS2C
xpdf-japanese/CMap/UniJIS-UCS2-HW-H
xpdf-japanese/CMap/WP-Symbol
xpdf-japanese/CMap/UniJIS-UTF16-H
xpdf-japanese/CMap/Ext-RKSJ-H
xpdf-japanese/CMap/UniJIS-UCS2-HW-V
xpdf-japanese/CMap/Add-RKSJ-V
xpdf-japanese/CMap/UniJIS-UTF8-H
xpdf-japanese/CMap/90ms-RKSJ-H
xpdf-japanese/CMap/Adobe-Japan1-UCS2
xpdf-japanese/CMap/Adobe-Japan1-1
xpdf-japanese/CMap/UniJIS2004-UTF16-H
xpdf-japanese/CMap/90pv-RKSJ-V
xpdf-japanese/CMap/UniJIS-UCS2-H
xpdf-japanese/CMap/NWP-V
xpdf-japanese/CMap/RKSJ-H
xpdf-japanese/CMap/NWP-H
xpdf-japanese/CMap/Hiragana
xpdf-japanese/CMap/78-V
xpdf-japanese/CMap/Add-V
xpdf-japanese/CMap/RKSJ-V
xpdf-japanese/CMap/78-RKSJ-V
xpdf-japanese/CMap/78-H
xpdf-japanese/CMap/H
xpdf-japanese/CMap/UniJIS2004-UTF32-H
xpdf-japanese/CMap/Adobe-Japan1-4
xpdf-japanese/CMap/78ms-RKSJ-V
xpdf-japanese/CMap/EUC-H
xpdf-japanese/CMap/78-RKSJ-H
xpdf-japanese/CMap/Adobe-Japan1-5
xpdf-japanese/README
xpdf-japanese/add-to-xpdfrc
xpdf-japanese/Adobe-Japan1.cidToUnicode
xpdf-japanese/EUC-JP.unicodeMap
xpdf-korean/
xpdf-korean/ISO-2022-KR.unicodeMap
xpdf-korean/Adobe-Korea1.cidToUnicode
xpdf-korean/CMap/
xpdf-korean/CMap/KSCpc-EUC-H
xpdf-korean/CMap/KSC-EUC-V
xpdf-korean/CMap/KSCms-UHC-UCS2
xpdf-korean/CMap/KSC-V
xpdf-korean/CMap/KSCpc-EUC-UCS2C
xpdf-korean/CMap/UniKS-UCS2-H
xpdf-korean/CMap/KSCpc-EUC-V
xpdf-korean/CMap/KSC-EUC-H
xpdf-korean/CMap/KSCms-UHC-HW-H
xpdf-korean/CMap/UniKS-UTF32-V
xpdf-korean/CMap/Adobe-Korea1-UCS2
xpdf-korean/CMap/Adobe-Korea1-0
xpdf-korean/CMap/KSCpc-EUC-UCS2
xpdf-korean/CMap/KSCms-UHC-HW-V
xpdf-korean/CMap/KSCms-UHC-H
xpdf-korean/CMap/UniKS-UTF32-H
xpdf-korean/CMap/UniKS-UTF16-H
xpdf-korean/CMap/Adobe-Korea1-1
xpdf-korean/CMap/UniKS-UCS2-V
xpdf-korean/CMap/KSCms-UHC-V
xpdf-korean/CMap/UniKS-UTF8-H
xpdf-korean/CMap/KSC-Johab-V
xpdf-korean/CMap/Adobe-Korea1-2
xpdf-korean/CMap/KSC-Johab-H
xpdf-korean/CMap/UniKS-UTF8-V
xpdf-korean/CMap/KSC-H
xpdf-korean/CMap/UniKS-UTF16-V
xpdf-korean/README
xpdf-korean/add-to-xpdfrc
xpdf-latin2/
xpdf-latin2/README
xpdf-latin2/add-to-xpdfrc
xpdf-latin2/Latin2.unicodeMap
xpdf-t1fonts/
xpdf-t1fonts/s050000l.pfb
xpdf-t1fonts/COPYING
xpdf-t1fonts/d050000l.pfb
xpdf-t1fonts/README
xpdf-thai/
xpdf-thai/TIS-620.unicodeMap
xpdf-thai/README
xpdf-thai/add-to-xpdfrc
xpdf-thai/Thai.nameToUnicode
xpdf-turkish/
xpdf-turkish/README
xpdf-turkish/add-to-xpdfrc
xpdf-turkish/ISO-8859-9.unicodeMap

Step 4: see all content */add-to-xpdfrc

[root@tutorialspots fonts]# cat */add-to-xpdfrc
#----- begin Arabic support package (2011-aug-15)
unicodeMap      ISO-8859-6      /usr/local/share/xpdf/arabic/ISO-8859-6.unicodeMap
#----- end Arabic support package
#----- begin Chinese Simplified support package (2011-sep-02)
cidToUnicode    Adobe-GB1       /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
unicodeMap      ISO-2022-CN     /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
unicodeMap      EUC-CN          /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
unicodeMap      GBK             /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap
cMapDir         Adobe-GB1       /usr/local/share/xpdf/chinese-simplified/CMap
toUnicodeDir                    /usr/local/share/xpdf/chinese-simplified/CMap
#fontFileCC     Adobe-GB1       /usr/..../NotoSansCJKsc-Regular.otf
#----- end Chinese Simplified support package
#----- begin Chinese Traditional support package (2011-sep-02)
cidToUnicode    Adobe-CNS1      /usr/local/share/xpdf/chinese-traditional/Adobe-CNS1.cidToUnicode
unicodeMap      Big5            /usr/local/share/xpdf/chinese-traditional/Big5.unicodeMap
unicodeMap      Big5ascii       /usr/local/share/xpdf/chinese-traditional/Big5ascii.unicodeMap
cMapDir         Adobe-CNS1      /usr/local/share/xpdf/chinese-traditional/CMap
toUnicodeDir                    /usr/local/share/xpdf/chinese-traditional/CMap
#fontFileCC     Adobe-CNS1      /usr/..../NotoSansCJKtc-Regular.otf"
#----- end Chinese Traditional support package
#----- begin Cyrillic support package (2011-aug-15)
nameToUnicode                   /usr/local/share/xpdf/cyrillic/Bulgarian.nameToUnicode
unicodeMap      KOI8-R          /usr/local/share/xpdf/cyrillic/KOI8-R.unicodeMap
#----- end Cyrillic support package
#----- begin Greek support package (2011-aug-15)
nameToUnicode                   /usr/local/share/xpdf/greek/Greek.nameToUnicode
unicodeMap      ISO-8859-7      /usr/local/share/xpdf/greek/ISO-8859-7.unicodeMap
#----- end Greek support package
#----- begin Hebrew support package (2011-aug-15)
unicodeMap      ISO-8859-8      /usr/local/share/xpdf/hebrew/ISO-8859-8.unicodeMap
unicodeMap      Windows-1255    /usr/local/share/xpdf/hebrew/Windows-1255.unicodeMap
#----- end Hebrew support package
#----- begin Japanese support package (2011-sep-02)
cidToUnicode    Adobe-Japan1    /usr/local/share/xpdf/japanese/Adobe-Japan1.cidToUnicode
unicodeMap      ISO-2022-JP     /usr/local/share/xpdf/japanese/ISO-2022-JP.unicodeMap
unicodeMap      EUC-JP          /usr/local/share/xpdf/japanese/EUC-JP.unicodeMap
unicodeMap      Shift-JIS       /usr/local/share/xpdf/japanese/Shift-JIS.unicodeMap
cMapDir         Adobe-Japan1    /usr/local/share/xpdf/japanese/CMap
toUnicodeDir                    /usr/local/share/xpdf/japanese/CMap
#fontFileCC     Adobe-Japan1    /usr/..../NotoSansCJKjp-Regular.otf
#----- end Japanese support package
#----- begin Korean support package (2011-sep-02)
cidToUnicode    Adobe-Korea1    /usr/local/share/xpdf/korean/Adobe-Korea1.cidToUnicode
unicodeMap      ISO-2022-KR     /usr/local/share/xpdf/korean/ISO-2022-KR.unicodeMap
cMapDir         Adobe-Korea1    /usr/local/share/xpdf/korean/CMap
toUnicodeDir                    /usr/local/share/xpdf/korean/CMap
#fontFileCC     Adobe-Korea1    /usr/..../NotoSansCJKkr-Regular.otf
#----- end Korean support package
#----- begin Latin2 support package (2011-aug-15)
unicodeMap      Latin2  /usr/local/share/xpdf/latin2/Latin2.unicodeMap
#----- end Latin2 support package
#----- begin Thai support package (2011-aug-15)
nameToUnicode                   /usr/local/share/xpdf/thai/Thai.nameToUnicode
unicodeMap      TIS-620         /usr/local/share/xpdf/thai/TIS-620.unicodeMap
#----- end Thai support package
#----- begin Turkish support package (2011-aug-15)
unicodeMap      ISO-8859-9      /usr/local/share/xpdf/turkish/ISO-8859-9.unicodeMap
#----- end Turkish support package

We must change /usr/local/share/xpdf/ to /root/xpdf-tools-linux-4.00/fonts/xpdf-
Then add that content to file $HOME/.xpdfrc

cat */add-to-xpdfrc > $HOME/.xpdfrc && sed -i 's/\/usr\/local\/share\/xpdf\//\/root\/xpdf-tools-linux-4.00\/fonts\/xpdf-/g' $HOME/.xpdfrc

You can add some config like this example file .xpdfrc

       # from the Thai support package
       nameToUnicode /usr/local/share/xpdf/Thai.nameToUnicode

       # from the Japanese support package
       cidToUnicode Adobe-Japan1 /usr/local/share/xpdf/Adobe-Japan1.cidToUnicode
       unicodeMap   JISX0208     /usr/local/share/xpdf/JISX0208.unicodeMap
       cMapDir      Adobe-Japan1 /usr/local/share/xpdf/cmap/Adobe-Japan1

       # use the Base-14 Type 1 fonts from ghostscript
       fontFile Times-Roman           /usr/local/share/ghostscript/fonts/n021003l.pfb
       fontFile Times-Italic          /usr/local/share/ghostscript/fonts/n021023l.pfb
       fontFile Times-Bold            /usr/local/share/ghostscript/fonts/n021004l.pfb
       fontFile Times-BoldItalic      /usr/local/share/ghostscript/fonts/n021024l.pfb
       fontFile Helvetica             /usr/local/share/ghostscript/fonts/n019003l.pfb
       fontFile Helvetica-Oblique     /usr/local/share/ghostscript/fonts/n019023l.pfb
       fontFile Helvetica-Bold        /usr/local/share/ghostscript/fonts/n019004l.pfb
       fontFile Helvetica-BoldOblique /usr/local/share/ghostscript/fonts/n019024l.pfb
       fontFile Courier               /usr/local/share/ghostscript/fonts/n022003l.pfb
       fontFile Courier-Oblique       /usr/local/share/ghostscript/fonts/n022023l.pfb
       fontFile Courier-Bold          /usr/local/share/ghostscript/fonts/n022004l.pfb
       fontFile Courier-BoldOblique   /usr/local/share/ghostscript/fonts/n022024l.pfb
       fontFile Symbol                /usr/local/share/ghostscript/fonts/s050000l.pfb
       fontFile ZapfDingbats          /usr/local/share/ghostscript/fonts/d050000l.pfb

       # use the Bakoma Type 1 fonts
       # (this assumes they happen to be installed in /usr/local/fonts/bakoma)
       fontDir /usr/local/fonts/bakoma

       # set some PostScript options
       psPaperSize          letter
       psDuplex             no
       psLevel              level2
       psEmbedType1Fonts    yes
       psEmbedTrueTypeFonts yes

       # assume that the PostScript printer has the Univers and
       # Univers-Bold fonts
       psResidentFont Univers      Univers
       psResidentFont Univers-Bold Univers-Bold

       # set the text output options
       textEncoding UTF-8
       textEOL      unix

       # misc options
       enableFreeType  yes
       launchCommand   viewer-script

Leave a Reply