Do you have any idea how to extract a part of a PDF document and save it as PDF? On OS X it is absolutely trivial by using Preview. I tried PDF editor and other programs but to no avail.
I would like a program where I select the part that I want and then save it as a PDF file with a simple command like CMD+N on OS X. I want the extracted part to be saved as PDF and not as JPEG, etc.
pdftk
is a useful multi-platform tool for the job (pdftk homepage).you pass the filename of the main pdf, then you tell it to only include certain pages (12-15 in this example) and output it to a new file.
Installation instructions:
To install the snap version, which is an unofficial repackaging of an old version of PDFtk (repackaged by Scott Moser), visit this link or run:
Alternatively, you can install an open source port of PDFtk to Java by Marc Vinyals, by running:
Another alternative is PDFtk Server, available from the website: https://www.pdflabs.com/tools/pdftk-server/ . This version is free of charge for personal use, but it is not open source.
Very simple. Use the default PDF reader, select "Print To File" and that's it!
Then:
Note that with this way, the text will no more be searchable, instead all texts are converted to images: this is how "Print" works.
QPDF is great. Use it this way to extract pages 1-10 from
input.pdf
and save it asoutput.pdf
:This preserves all metadata associated with that file.
From the manual:
You can install it by invoking:
It is a great tool for PDF manipulation. It's very fast and has very few dependencies. "It can encrypt and linearize files, expose the internals of a PDF file, and do many other operations useful to end users and PDF developers."
QPDF's code repository on GitHub.
Page range - Nautilus script
Overview
I created a slightly more advanced script based on the tutorial @ThiagoPonte linked to. Its key features are
Screenshot
Code
Installation
Please follow the generic installation instructions for Nautilus scripts. Make sure to read the script header carefully as it will help to clarify the installation and usage of the script.
Partial pages - PDF Arranger
Overview
Installation
Usage
PDF Arranger can crop and delete single PDF pages. You can use it to extract a page range from a document or even partial pages using the cropping function:
Page elements - Inkscape
Overview
Inkscape is a very powerful open-source vector graphics editor. It supports a wide range of different formats, including PDF files. You can use it to extract, modify and save page elements from a PDF file.
Installation
Usage
1.) Open the PDF file of your choice with Inkscape. An import dialog will appear. Choose the page you want to extract elements from. Leave the other settings as they are:
2.) In Inkscape click and drag to select the element(s) you want to extract:
3.) Invert the selection with ! and delete the selected object with DELETE:
4.) Crop the document to the remaining objects by accessing the Document Properties dialog with CTRL+SHIFT+D and selecting "fit document to image":
5.) Save the document as a PDF file from the File --> Save as dialog:
6.) If there are bitmap/raster images in your cropped document you can set their DPI in the dialog that appears next:
7.) If you followed all steps you will have produced a true PDF file that only consists of the objects of your choice:
Save this as a shell script, like pdfextractor.sh:
To run type:
4
refers to the page it will start the new pdf.20
refers to the page it will end the pdf with.myfile.pdf
is the pdf file you want to extract parts.The output would be
myfile_p4_p20.pdf
in the same directory the original pdf file.All this and more information here: Tech Tip
In any system that a TeX distribution is installed:
For example:
See https://tex.stackexchange.com/a/79626/8666
There is a command line utility called pdfseparate.
From the docs:
Or, to select a single page (in this case, the first page) from the file sample.pdf:
pdftk
(sudo apt-get install pdftk
) is a great command line too for PDF manipulation. Here are some examples of whatpdftk
can do:In your case, I would do:
I was trying to do the same. All you have to do is:
install
pdftk
:if you want to extract random pages:
if you want to extract a range:
Please check the source for more infos.
Have you tried PDF Mod?
You can for example.. extract pages and save them as pdf.
Description:
PDF Mod is a simple tool for modifying PDF documents. It can rotate, extract, remove
and reorder pages via drag and drop. Multiple documents may be combined via drag
and drop. You may also edit the title, subject, author and keywords of a PDF
document using PDF Mod.
Hope this will useful.
Regars.