Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I'm trying to use pdfimages to extract an image from a pdf file.
In this case the file is called sample.pdf & I want to extract page 9 from the file.
Usage: pdfimages [options] <PDF-file> <image-root>
-f <int> : first page to convert
-l <int> : last page to convert
-j : write JPEG images as JPEG files
-opw <string> : owner password (for encrypted files)
-upw <string> : user password (for encrypted files)
-q : don't print any messages or errors
-cfg <string> : configuration file to use in place of .xpdfrc
-v : print copyright and version info
-h : print usage information
-help : print usage information
--help : print usage information
-? : print usage information
So I would type:
pdfimages [-f9 -l9] sample.pdf...? I don't understand the <image-root> part. If some one could give me a proper example (explanations optional) it would be of great help.
Below is the "man" page for pdfimages. It sounds like your suggested syntax is correct, and that "image-root" simply specifies what your output file is going to be called.
I'd suggest trying this (assuming you haven't already):
pdfimages -f 9 -l 9 sample.pdf test
I'd also suggest looking for a "/usr/local/etc/xpdfrc" configuration file to control what the output format will be.
'Hope that helps .. PSM
pdfimages - Portable Document Format (PDF) image extractor
pdfimages [options] PDF-file image-root
Pdfimages saves images from a Portable Document Format
(PDF) file as Portable Pixmap (PPM), Portable Bitmap
(PBM), or JPEG files.
Pdfimages reads the PDF file, scans one or more pages,
PDF-file, and writes one PPM, PBM, or JPEG file for each
image, image-root-nnn.xxx, where nnn is the image number
and xxx is the image type (.ppm, .pbm, .jpg).
Pdfimages reads a configuration file at startup. It first
tries to find the user's private config file, ~/.xpdfrc.
If that doesn't exist, it looks for a system-wide config
file, typically /usr/local/etc/xpdfrc (but this location
can be changed when pdfimages is built). See the
xpdfrc(5) man page for details.
Many of the following options can be set with configura-
tion file commands. These are listed in square brackets
with the description of the corresponding command line
Specifies the first page to scan.
Specifies the last page to scan.
-j Normally, all images are written as PBM (for
monochrome images) or PPM (for non-monochrome
images) files. With this option, images in DCT
format are saved as JPEG files. All non-DCT images
are saved in PBM/PPM format as usual.
Specify the owner password for the PDF file. Pro-
viding this will bypass all security restrictions.
Specify the user password for the PDF file.
-q Don't print any messages or errors. [config file:
-v Print copyright and version information.
-h Print usage information. (-help and --help are
The Xpdf tools use the following exit codes:
0 No error.
1 Error opening a PDF file.
2 Error opening an output file.
3 Error related to PDF permissions.
99 Other error.
The pdfimages software and documentation are copyright
1998-2003 Glyph & Cog, LLC.
I don't know what image-root means either. Be sure to leave out the [ ] when giving commands. Those are descriptions in the syntax line. I think they mean that the options in the brackets are optional. Also be sure to leave a space between option flags and option arguments
So I would type:
pdfimages [-f9 -l9] sample.pdf...?
image root specifies the basename of your output file. For eg. if you want the images to be called as my-pic-1.jpg, my-pic-2.jpg..... , you would specify my-pic as the image-root which, pdfimage would use and append the numbers and extension to it.