Rearrange PDF pages using the command-line
I want to rearrange the pages in a PDF file. But because I have to rearrange many pages, and the new arrangement has a specific pattern, I would like to do so with a script. Is there a simple program which allows to rearrange the pages in a PDF?
Alternatively I could also extract all pages and merge them together in the order I want. What progams are available to do this?
command-line pdf
add a comment |
I want to rearrange the pages in a PDF file. But because I have to rearrange many pages, and the new arrangement has a specific pattern, I would like to do so with a script. Is there a simple program which allows to rearrange the pages in a PDF?
Alternatively I could also extract all pages and merge them together in the order I want. What progams are available to do this?
command-line pdf
add a comment |
I want to rearrange the pages in a PDF file. But because I have to rearrange many pages, and the new arrangement has a specific pattern, I would like to do so with a script. Is there a simple program which allows to rearrange the pages in a PDF?
Alternatively I could also extract all pages and merge them together in the order I want. What progams are available to do this?
command-line pdf
I want to rearrange the pages in a PDF file. But because I have to rearrange many pages, and the new arrangement has a specific pattern, I would like to do so with a script. Is there a simple program which allows to rearrange the pages in a PDF?
Alternatively I could also extract all pages and merge them together in the order I want. What progams are available to do this?
command-line pdf
command-line pdf
asked Sep 6 '17 at 11:47
red_trumpetred_trumpet
6611826
6611826
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
pdftk
is the one you're searching for. E.g. if you want to reverse the page order of i.pdf
, do
pdftk i.pdf cat end-1 output o.pdf
Other examples showing pdftk
's potential:
pdftk i.pdf cat 4-1 6 8-end output o.pdf # use ranges
pdftk i.pdf cat 1-6even output o.pdf # print only even pages in the range
pdftk i.pdf cat 1-10 ~5-7 output o.pdf # exclude pages in the range
pdftk i.pdf burst # extract to single-page pdf files
Read man pdftk
for more information.
To install pdftk
on 18.04 see: How can I install pdftk in Ubuntu 18.04 Bionic?
If you after all search for a GUI solution have a look at pdftk
's GUI pdfchain
or pdfmod
.
add a comment |
You can also try pdfjam
pdfnup
(based on LaTeX pdf-pages)
Example:
pdfjam i.pdf '{},2,1-5' -o o.pdf
pdfjam f1.pdf f2.pdf f3.pdf 1-3 -o o.pdf ## first 3 pages from f1,f2,f3
{}
inserts an empty page- many options available (ex: scale, offset, trim, frame, nup) -- see pdfjam man
add a comment |
You can use qpdf which comes with ubuntu. This following command for example puts the pages in reverse order.
qpdf --empty --pages infile.pdf z-1 -- outfile.pdf
You can find more information and other examples here on pages 10 and 11.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f953271%2frearrange-pdf-pages-using-the-command-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
pdftk
is the one you're searching for. E.g. if you want to reverse the page order of i.pdf
, do
pdftk i.pdf cat end-1 output o.pdf
Other examples showing pdftk
's potential:
pdftk i.pdf cat 4-1 6 8-end output o.pdf # use ranges
pdftk i.pdf cat 1-6even output o.pdf # print only even pages in the range
pdftk i.pdf cat 1-10 ~5-7 output o.pdf # exclude pages in the range
pdftk i.pdf burst # extract to single-page pdf files
Read man pdftk
for more information.
To install pdftk
on 18.04 see: How can I install pdftk in Ubuntu 18.04 Bionic?
If you after all search for a GUI solution have a look at pdftk
's GUI pdfchain
or pdfmod
.
add a comment |
pdftk
is the one you're searching for. E.g. if you want to reverse the page order of i.pdf
, do
pdftk i.pdf cat end-1 output o.pdf
Other examples showing pdftk
's potential:
pdftk i.pdf cat 4-1 6 8-end output o.pdf # use ranges
pdftk i.pdf cat 1-6even output o.pdf # print only even pages in the range
pdftk i.pdf cat 1-10 ~5-7 output o.pdf # exclude pages in the range
pdftk i.pdf burst # extract to single-page pdf files
Read man pdftk
for more information.
To install pdftk
on 18.04 see: How can I install pdftk in Ubuntu 18.04 Bionic?
If you after all search for a GUI solution have a look at pdftk
's GUI pdfchain
or pdfmod
.
add a comment |
pdftk
is the one you're searching for. E.g. if you want to reverse the page order of i.pdf
, do
pdftk i.pdf cat end-1 output o.pdf
Other examples showing pdftk
's potential:
pdftk i.pdf cat 4-1 6 8-end output o.pdf # use ranges
pdftk i.pdf cat 1-6even output o.pdf # print only even pages in the range
pdftk i.pdf cat 1-10 ~5-7 output o.pdf # exclude pages in the range
pdftk i.pdf burst # extract to single-page pdf files
Read man pdftk
for more information.
To install pdftk
on 18.04 see: How can I install pdftk in Ubuntu 18.04 Bionic?
If you after all search for a GUI solution have a look at pdftk
's GUI pdfchain
or pdfmod
.
pdftk
is the one you're searching for. E.g. if you want to reverse the page order of i.pdf
, do
pdftk i.pdf cat end-1 output o.pdf
Other examples showing pdftk
's potential:
pdftk i.pdf cat 4-1 6 8-end output o.pdf # use ranges
pdftk i.pdf cat 1-6even output o.pdf # print only even pages in the range
pdftk i.pdf cat 1-10 ~5-7 output o.pdf # exclude pages in the range
pdftk i.pdf burst # extract to single-page pdf files
Read man pdftk
for more information.
To install pdftk
on 18.04 see: How can I install pdftk in Ubuntu 18.04 Bionic?
If you after all search for a GUI solution have a look at pdftk
's GUI pdfchain
or pdfmod
.
edited Aug 9 '18 at 11:09
answered Sep 6 '17 at 11:49
dessertdessert
24.7k672105
24.7k672105
add a comment |
add a comment |
You can also try pdfjam
pdfnup
(based on LaTeX pdf-pages)
Example:
pdfjam i.pdf '{},2,1-5' -o o.pdf
pdfjam f1.pdf f2.pdf f3.pdf 1-3 -o o.pdf ## first 3 pages from f1,f2,f3
{}
inserts an empty page- many options available (ex: scale, offset, trim, frame, nup) -- see pdfjam man
add a comment |
You can also try pdfjam
pdfnup
(based on LaTeX pdf-pages)
Example:
pdfjam i.pdf '{},2,1-5' -o o.pdf
pdfjam f1.pdf f2.pdf f3.pdf 1-3 -o o.pdf ## first 3 pages from f1,f2,f3
{}
inserts an empty page- many options available (ex: scale, offset, trim, frame, nup) -- see pdfjam man
add a comment |
You can also try pdfjam
pdfnup
(based on LaTeX pdf-pages)
Example:
pdfjam i.pdf '{},2,1-5' -o o.pdf
pdfjam f1.pdf f2.pdf f3.pdf 1-3 -o o.pdf ## first 3 pages from f1,f2,f3
{}
inserts an empty page- many options available (ex: scale, offset, trim, frame, nup) -- see pdfjam man
You can also try pdfjam
pdfnup
(based on LaTeX pdf-pages)
Example:
pdfjam i.pdf '{},2,1-5' -o o.pdf
pdfjam f1.pdf f2.pdf f3.pdf 1-3 -o o.pdf ## first 3 pages from f1,f2,f3
{}
inserts an empty page- many options available (ex: scale, offset, trim, frame, nup) -- see pdfjam man
edited Feb 19 '18 at 20:39
dessert
24.7k672105
24.7k672105
answered Sep 6 '17 at 17:27
JJoaoJJoao
1,40069
1,40069
add a comment |
add a comment |
You can use qpdf which comes with ubuntu. This following command for example puts the pages in reverse order.
qpdf --empty --pages infile.pdf z-1 -- outfile.pdf
You can find more information and other examples here on pages 10 and 11.
add a comment |
You can use qpdf which comes with ubuntu. This following command for example puts the pages in reverse order.
qpdf --empty --pages infile.pdf z-1 -- outfile.pdf
You can find more information and other examples here on pages 10 and 11.
add a comment |
You can use qpdf which comes with ubuntu. This following command for example puts the pages in reverse order.
qpdf --empty --pages infile.pdf z-1 -- outfile.pdf
You can find more information and other examples here on pages 10 and 11.
You can use qpdf which comes with ubuntu. This following command for example puts the pages in reverse order.
qpdf --empty --pages infile.pdf z-1 -- outfile.pdf
You can find more information and other examples here on pages 10 and 11.
answered 37 mins ago
SaTaSaTa
6017
6017
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f953271%2frearrange-pdf-pages-using-the-command-line%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown