4月 242013
 

There are bascially 2 types of pdf-to-html converters:
One is roughly a pdf-to-text converter with a few pre-defined formats in HTML.
The other is render-everything-as-images converter, which loses all text and generated huge files.

But pdf2htmlEX takes advatanges of both, retaining both Text and Styling.
Features:
1.Extract and embed fonts from PDF
2.Optimizing for web while making sure render is precise
3.Non-text objects are rendered as images.
4.Single-file output mode — I know you hate spearated font/image files Continue reading »

8月 092010
 

1.PDF转JPG

安装一个软件ImageMagick:
# sudo apt-get install imageMagick
然后就可以转换了,yes!!
# convert XXX.pdf XXX.jpg
这样XXX.pdf 就转换成了一大堆的XXX-*.jpg,一页一张JPG。
如果想清晰些(实验中):
# convert -verbose -colorspace RGB -resize 1800 -interlace none -density 300 -quality 100 XXX.pdf XXX.jpg

2. PDF转txt
我们要用poppler来做,它是系统自带的,
呵呵,先加一个中文支持:
# sudo apt-get install poppler-data

嘻嘻,转换啦!!
# pdftotext -layout -nopgbrk XXX.pdf
因为pdftotext不支持同时处理多个 pdf,所以用批处理要脚本搞定,打开终端,进入放置 pdf 的目录,运行下面命令
find ./ -name '*.pdf' | while read i; do pdftotext -layout -nopgbrk $i; done
很快就在当前目录下输出很多 txt 文件,“-layout”参数表示保留页面布局,“-nopgbrk”表示不输出换行符,自己对比一下就知道区别了。

4月 062010
 

现象:Ubuntu默认的PDF阅读器是Poppler PDF utilities,有时候会遇到不能显示文字的情况(包括英文的文档,也不能完整显示)
解决:通过新立得软件包管理器安装一下Poppler-data(Encoding data for the poppler PDF rendering library),这个包10多M,安装后一般都能正常显示了。