Ubuntu pdf to jpg or txt

Source: Internet
Author: User
Tags imagemagick

from:http://chenlei.is-programmer.com/posts/14419


1) PDF to JPG:

Install a software ImageMagick:

# sudo apt-get install ImageMagick

And then it can be converted, yes!!.

# convert Xxx.pdf xxx.jpg

So the xxx.pdf converted into a whole bunch of xxx-*.jpg, one page and one JPG.

If you want to be clear (in the experiment):

# convert-verbose-colorspace rgb-resize 1800-interlace none-density 300-quality xxx.pdf XXX.jpg

(2) PDF to txt:

We're going to do it with Poppler, and it's a system that comes with it.

Oh, first add a Chinese support:

# sudo apt-get install Poppler-data

hehe, conversion.

# PDFTOTEXT-LAYOUT-NOPGBRK Xxx.pdf

Because Pdftotext does not support working with multiple PDFs at the same time, use batch processing to script, open the terminal, go to the directory where the PDF is placed, run the command below

Find./-name ' *.pdf ' | while read I; Do pdftotext-layout-nopgbrk $i; Done

Soon in the current directory output a lot of txt file, "-layout" parameter means to preserve the page layout, "-nopgbrk" means not output line breaks, you know the difference by comparison.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.