- [Root @ localhost ~] # Mkdir-p/lcf/upan
- [Root @ localhost ~] # Mkdir-p/lcf/cdrom
- [Root @ localhost ~] # Mkdir-p/lcf/xpdf
- [Root @ localhost ~] # Cd/lcf/upan/
- [Root @ localhost upan] # cp xpdf/* ../xpdf/(put the downloaded file in the/lcf/xpdf directory)
- [Root @ localhost upan] # cd ../xpdf/
- [Root @ localhost xpdf] # tar-zxvf xpdfbin-linux-3.03.tar.gz
- [Root @ localhost xpdf] # cd xpdfbin-linux-3.03
- [Root @ localhost xpdfbin-linux-3.03] # cat INSTALL
- [Root @ localhost xpdfbin-linux-3.03] # cd bin32/
- [Root @ localhost bin32] # cp./*/usr/local/bin/
- [Root @ localhost bin32] # cd ../doc/
- [Root @ localhost doc] # mkdir-p/usr/local/man/man1
- [Root @ localhost doc] # mkdir-p/usr/local/man/man5
- [Root @ localhost doc] # cp *. 1/usr/local/man/man1
- [Root @ localhost doc] # cp *. 5/usr/local/man/man5
If you do not need to read Chinese characters, it will end up here. if you need to, we will continue later.
- [Root @ localhost doc] # cp sample-xpdfrc/usr/local/etc/xpdfrc
- [Root @ localhost xpdf] # cd/lcf/xpdf
- [Root @ localhost xpdf] # tar-zxvf xpdf-chinese-simplified.tar.gz
- [Root @ localhost xpdf] # cd xpdf-chinese-simplified
- [Root @ localhost xpdf] # mkdir-p/usr/local/share/xpdf/chinese-simplified
- [Root @ localhost xpdf] # cd xpdf-chinese-simplified/
- [Root @ localhost xpdf-chinese-simplified] # cp Adobe-GB1.cidToUnicode ISO-2022-CN.unicodeMap EUC-CN.unicodeMap GBK. unicodeMap CMAP/usr/local/share/xpdf/chinese-simplified/
Copy the add-to-xpdfrc file in the chinese-simplified file to the/usr/local/etc/xpdfrc file. Remember that the path is correct. (Note, here the simplified Chinese package includes the following three formats: ISO-2022-CN, EUC-CN, GBK, see clearly Oh, does not support UTF-8, you can first convert to GBK, then escape) 3. now that the function is implemented, all configurations are complete and we will start to use it. If it is a simple PDF reading, you can use the following statement directly. $ Content = shell_exec ('/usr/local/bin/plain totext'. $ filename.'-'); if you want to convert Chinese characters, add a parameter. $ Content = shell_exec ('/usr/local/bin/fig-layout-enc GBK '. $ filename. '-'); of course, after adding a parameter, the English conversion is still not affected, so feel free to use it. It should be noted that the transfer out here is GBK encoding Oh, now many websites use UTF-8, do not display garbled characters, you need to escape again. $ Content = mb_convert_encoding ($ content, 'utf-8', 'gbk'); the read content can be processed by writing code. Optional totext: optionspointer of the following options can be set with configuration file com-mands. these are listed in square brackets with the description of thecorresponding command line option. -f numberSpecifies the first page to convert. -l numberSpecifies the last page to convert. -layoutMaintain (as best as possible) the original physical layout ofthe text. the default is to 'undo 'physical layout (columns, hyphenation, etc .) and output the text in reading order. -fixed numberAssume fixed-pitch (or tabular) text, with the specified charac-ter width (in points ). this forces physical layout mode. -raw Keep the text in content stream order. this is a hack whichoften "undoes" column formatting, etc. use of raw mode is nolonger recommended. -htmlmetaGenerate a simple HTML file, including the meta information. this simply wraps the text in and And prepends themeta headers.-enc encoding-name |