* [gentoo-user] Joining PDF files together.
@ 2020-07-09 13:31 Alan Mackenzie
2020-07-09 13:35 ` John Blinka
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Alan Mackenzie @ 2020-07-09 13:31 UTC (permalink / raw
To: gentoo-user
Hello, Gentoo.
I've just scanned in a two-page document using sane, and it's given me
as output two separate files. I would like to join these together into
a single document.
Would somebody please suggest to me an appropriate package to do this
with.
Thanks!
Other than that, Gentoo just keeps working for me, so I've not much to
say on this list. ;-)
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
@ 2020-07-09 13:35 ` John Blinka
2020-07-09 15:30 ` Rich Freeman
2020-07-09 13:37 ` Remco Rijnders
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: John Blinka @ 2020-07-09 13:35 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 637 bytes --]
On Thu, Jul 9, 2020 at 9:31 AM Alan Mackenzie <acm@muc.de> wrote:
> Hello, Gentoo.
>
> I've just scanned in a two-page document using sane, and it's given me
> as output two separate files. I would like to join these together into
> a single document.
>
> Would somebody please suggest to me an appropriate package to do this
> with.
>
> Thanks!
>
> Other than that, Gentoo just keeps working for me, so I've not much to
> say on this list. ;-)
>
> --
> Alan Mackenzie (Nuremberg, Germany).
>
> app-text/pdftk
pdftk page-1.pdf page-2.pdf cat output both.pdf
Lots of other useful tricks it can do with pdf files.
hth -
John Blinka
[-- Attachment #2: Type: text/html, Size: 1170 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
2020-07-09 13:35 ` John Blinka
@ 2020-07-09 13:37 ` Remco Rijnders
2020-07-09 14:33 ` Matt Connell (Gmail)
2020-07-09 15:37 ` Tamer Higazi
` (3 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Remco Rijnders @ 2020-07-09 13:37 UTC (permalink / raw
To: gentoo-user
On Thu, Jul 09, 2020 at 01:31:36PM +0000, Alan wrote in
<20200709133136.GA4852@ACM>:
>Hello, Gentoo.
>
>I've just scanned in a two-page document using sane, and it's given me
>as output two separate files. I would like to join these together into
>a single document.
>
>Would somebody please suggest to me an appropriate package to do this
>with.
I have no experience with either myself, but I think you can use
either pdftk, or the pdfunite command in the poppler package.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:37 ` Remco Rijnders
@ 2020-07-09 14:33 ` Matt Connell (Gmail)
0 siblings, 0 replies; 15+ messages in thread
From: Matt Connell (Gmail) @ 2020-07-09 14:33 UTC (permalink / raw
To: gentoo-user
> I have no experience with either myself, but I think you can use
> either pdftk, or the pdfunite command in the poppler package.
+1 for poppler
It includes easy-to-use tools for uniting, separating, and converting
PDFs to other formats.
Also worth noting, pdftk requires java, which some users may not want
to install. Unless I'm mistaken, poppler is a Qt application.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:35 ` John Blinka
@ 2020-07-09 15:30 ` Rich Freeman
2020-07-09 17:20 ` Neil Bothwick
0 siblings, 1 reply; 15+ messages in thread
From: Rich Freeman @ 2020-07-09 15:30 UTC (permalink / raw
To: gentoo-user
On Thu, Jul 9, 2020 at 9:35 AM John Blinka <john.blinka@gmail.com> wrote:
>
> app-text/pdftk
>
> pdftk page-1.pdf page-2.pdf cat output both.pdf
>
> Lots of other useful tricks it can do with pdf files.
>
+1 for pdftk if you can stand java. I'm sure there are some GUI-based
options that you might prefer, but pdftk is great for command line
use.
I'll go ahead and offer this script that takes as input a bunch of pdf
files, and it combines them all adding blank pages as needed to make
them all even. This is used to generate a combined PDF suitable for
double-sided printing on a single-sided printer if I have a bunch of
PDFs I want to print in batch.
#!/bin/bash
for file in *.pdf
do
#get the number of pages
numberofpages=`pdftk "$file" dump_data | sed -e
'/NumberOfPages/!d;s/NumberOfPages: //'`
echo -n "$file" 'has' $numberofpages 'pages, '
uneven=$(($numberofpages % 2))
if [ $uneven == 1 ]
then
echo 'which is uneven - added 1 more'
tempfile=`mktemp`
pdftk A="$file" B=/usr/local/share/blank.pdf cat A B1 output "$tempfile"
mv $tempfile $file
else
echo 'which is even'
fi
done
pdftk *.pdf cat output out.pdf
--
Rich
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
2020-07-09 13:35 ` John Blinka
2020-07-09 13:37 ` Remco Rijnders
@ 2020-07-09 15:37 ` Tamer Higazi
2020-07-09 15:39 ` Gerrit Kuehn
` (2 subsequent siblings)
5 siblings, 0 replies; 15+ messages in thread
From: Tamer Higazi @ 2020-07-09 15:37 UTC (permalink / raw
To: gentoo-user
Dear Alan,
I do it with ghostscript (for my cv's and employers proof of work) all
the time, and even change the header.
Then look here:
http://milan.kupcevic.net/ghostscript-ps-pdf/
the best short documentation I found so far.
best, Tamer
On 2020-07-09 15:31, Alan Mackenzie wrote:
> Hello, Gentoo.
>
> I've just scanned in a two-page document using sane, and it's given me
> as output two separate files. I would like to join these together into
> a single document.
>
> Would somebody please suggest to me an appropriate package to do this
> with.
>
> Thanks!
>
> Other than that, Gentoo just keeps working for me, so I've not much to
> say on this list. ;-)
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
` (2 preceding siblings ...)
2020-07-09 15:37 ` Tamer Higazi
@ 2020-07-09 15:39 ` Gerrit Kuehn
2020-07-09 15:44 ` Tamer Higazi
2020-07-09 16:05 ` Simo Tukiainen
2020-07-10 8:26 ` Alan Mackenzie
5 siblings, 1 reply; 15+ messages in thread
From: Gerrit Kuehn @ 2020-07-09 15:39 UTC (permalink / raw
To: gentoo-user
On Thu, 9 Jul 2020 13:31:36 +0000
Alan Mackenzie <acm@muc.de> wrote:
> Would somebody please suggest to me an appropriate package to do this
> with.
I use ImageMagick for joining pages scanned with xsane:
convert page1 page2 pages.pdf
Note that especially for pdf files, tools like pdftk or pdfjam will
probably produce better results. However, (x)sane usually produces
very large pdf files. So you may receive better end results creating
separate png files with sane and then join these (using ImageMagick as
shown above).
cu
Gerrit
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 15:39 ` Gerrit Kuehn
@ 2020-07-09 15:44 ` Tamer Higazi
0 siblings, 0 replies; 15+ messages in thread
From: Tamer Higazi @ 2020-07-09 15:44 UTC (permalink / raw
To: gentoo-user
Ghostscript is installed by most pdf distributions, and if not merge it.
Look here:
gs -q -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=myoutput.pdf
fil21.pdf file2.pdf file3.pdf
best, Tamer
On 2020-07-09 17:39, Gerrit Kuehn wrote:
> On Thu, 9 Jul 2020 13:31:36 +0000
> Alan Mackenzie <acm@muc.de> wrote:
>
>> Would somebody please suggest to me an appropriate package to do this
>> with.
> I use ImageMagick for joining pages scanned with xsane:
>
> convert page1 page2 pages.pdf
>
> Note that especially for pdf files, tools like pdftk or pdfjam will
> probably produce better results. However, (x)sane usually produces
> very large pdf files. So you may receive better end results creating
> separate png files with sane and then join these (using ImageMagick as
> shown above).
>
>
> cu
> Gerrit
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
` (3 preceding siblings ...)
2020-07-09 15:39 ` Gerrit Kuehn
@ 2020-07-09 16:05 ` Simo Tukiainen
2020-07-09 17:25 ` Jarry
2020-07-10 8:26 ` Alan Mackenzie
5 siblings, 1 reply; 15+ messages in thread
From: Simo Tukiainen @ 2020-07-09 16:05 UTC (permalink / raw
To: gentoo-user
On Thu, 9 Jul 2020 at 16:32, Alan Mackenzie <acm@muc.de> wrote:
> I've just scanned in a two-page document using sane, and it's given me
> as output two separate files. I would like to join these together into
> a single document.
>
> Would somebody please suggest to me an appropriate package to do this
> with.
You already have many suggestions, but I'll mention app-text/pdfjam
(and pdfjoin it provides) just for completeness. I use it like this to
merge scanned documents:
$ pdfjoin --rotateoversize false --outfile x.pdf y-*.pdf
It's command line and only depends on virtual/latex-base so may be a
nice option if you already have a latex installed.
Regards,
Simo
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 15:30 ` Rich Freeman
@ 2020-07-09 17:20 ` Neil Bothwick
0 siblings, 0 replies; 15+ messages in thread
From: Neil Bothwick @ 2020-07-09 17:20 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
On Thu, 9 Jul 2020 11:30:17 -0400, Rich Freeman wrote:
> > app-text/pdftk
> >
> > pdftk page-1.pdf page-2.pdf cat output both.pdf
> >
> > Lots of other useful tricks it can do with pdf files.
> >
>
> +1 for pdftk if you can stand java. I'm sure there are some GUI-based
> options that you might prefer, but pdftk is great for command line
> use.
I'll add another vote for pdfunite, it's already installed on most
systems as it's part of poppler and it's as simple as
pdfunite file1 file2 ... output.pdf
--
Neil Bothwick
A Microsoft joke (is that a tautology?)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 16:05 ` Simo Tukiainen
@ 2020-07-09 17:25 ` Jarry
2020-07-09 17:32 ` Jack
0 siblings, 1 reply; 15+ messages in thread
From: Jarry @ 2020-07-09 17:25 UTC (permalink / raw
To: gentoo-user
On Thu, 9 Jul 2020 at 16:32, Alan Mackenzie <acm@muc.de> wrote:
> I've just scanned in a two-page document using sane, and it's given me
> as output two separate files. I would like to join these together into
> a single document.
>
> Would somebody please suggest to me an appropriate package to do this
> with.
Sorry for stealing this topic, but does any of mentioned packages
support "overlapping" one pdf-page over the other? Not sure if
I'm using the right word, but what I mean is "joining" two pdf
pages of the same size to single page, with content of both those
original pages written over each other to single output page.
I have been using "stamp" option of pdftk for this, but it crashes
sometimes...
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 17:25 ` Jarry
@ 2020-07-09 17:32 ` Jack
2020-07-09 17:37 ` Matt Connell (Gmail)
2020-07-09 17:49 ` Jarry
0 siblings, 2 replies; 15+ messages in thread
From: Jack @ 2020-07-09 17:32 UTC (permalink / raw
To: gentoo-user
On 2020.07.09 13:25, Jarry wrote:
> On Thu, 9 Jul 2020 at 16:32, Alan Mackenzie <acm@muc.de> wrote:
> > I've just scanned in a two-page document using sane, and it's given
> me
> > as output two separate files. I would like to join these together
> into
> > a single document.
> >
> > Would somebody please suggest to me an appropriate package to do
> this
> > with.
>
> Sorry for stealing this topic, but does any of mentioned packages
> support "overlapping" one pdf-page over the other? Not sure if
> I'm using the right word, but what I mean is "joining" two pdf
> pages of the same size to single page, with content of both those
> original pages written over each other to single output page.
>
> I have been using "stamp" option of pdftk for this, but it crashes
> sometimes...
I haven't done it, but would gimp work? It might be overkill, but
something about layers sounds appropriate.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 17:32 ` Jack
@ 2020-07-09 17:37 ` Matt Connell (Gmail)
2020-07-09 17:49 ` Jarry
1 sibling, 0 replies; 15+ messages in thread
From: Matt Connell (Gmail) @ 2020-07-09 17:37 UTC (permalink / raw
To: gentoo-user
On Thu, 2020-07-09 at 13:32 -0400, Jack wrote:
> I haven't done it, but would gimp work? It might be overkill, but
> something about layers sounds appropriate.
Gimp can in fact do this, I just tested it. You'll need to mess with
transparency perhaps, but as a proof-of-concept you can "paste as new
layer" with a PDF page layer from another file.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 17:32 ` Jack
2020-07-09 17:37 ` Matt Connell (Gmail)
@ 2020-07-09 17:49 ` Jarry
1 sibling, 0 replies; 15+ messages in thread
From: Jarry @ 2020-07-09 17:49 UTC (permalink / raw
To: gentoo-user
On 09-Jul-20 19:32, Jack wrote:
> On 2020.07.09 13:25, Jarry wrote:
>> On Thu, 9 Jul 2020 at 16:32, Alan Mackenzie <acm@muc.de> wrote:
>> > I've just scanned in a two-page document using sane, and it's given me
>> > as output two separate files. I would like to join these together into
>> > a single document.
>> >
>> > Would somebody please suggest to me an appropriate package to do this
>> > with.
>>
>> Sorry for stealing this topic, but does any of mentioned packages
>> support "overlapping" one pdf-page over the other? Not sure if
>> I'm using the right word, but what I mean is "joining" two pdf
>> pages of the same size to single page, with content of both those
>> original pages written over each other to single output page.
>>
>> I have been using "stamp" option of pdftk for this, but it crashes
>> sometimes...
> I haven't done it, but would gimp work? It might be overkill, but
> something about layers sounds appropriate.
>
It might work, but I'm doing it sometimes on large batches of files,
so I'd prefer scripted solution. From my experience pdftk crashes
about 4-5 times out of 100 operations. So I have to find those cases
when it failed and run them again...
Jarry
--
_______________________________________________________________
This mailbox accepts e-mails only from selected mailing-lists!
Everything else is considered to be spam and therefore deleted.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [gentoo-user] Joining PDF files together.
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
` (4 preceding siblings ...)
2020-07-09 16:05 ` Simo Tukiainen
@ 2020-07-10 8:26 ` Alan Mackenzie
5 siblings, 0 replies; 15+ messages in thread
From: Alan Mackenzie @ 2020-07-10 8:26 UTC (permalink / raw
To: gentoo-user
Hello, everybody on Gentoo.
On Thu, Jul 09, 2020 at 13:31:36 +0000, Alan Mackenzie wrote:
> I've just scanned in a two-page document using sane, and it's given me
> as output two separate files. I would like to join these together into
> a single document.
> Would somebody please suggest to me an appropriate package to do this
> with.
Thanks to everybody who responded with a suggestion. In the end, I used
pdfunite, simply because it was there. I don't have (and don't want)
Java on my system, so that ruled out pdftk.
Gerrit, you were quite right about sane producing ludicrously large PDF
files. I should have cut my file down before emailing it off, but
laziness got the better of me. :-(
gentoo-user is a tremendous group!
> Thanks!
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2020-07-10 8:26 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-09 13:31 [gentoo-user] Joining PDF files together Alan Mackenzie
2020-07-09 13:35 ` John Blinka
2020-07-09 15:30 ` Rich Freeman
2020-07-09 17:20 ` Neil Bothwick
2020-07-09 13:37 ` Remco Rijnders
2020-07-09 14:33 ` Matt Connell (Gmail)
2020-07-09 15:37 ` Tamer Higazi
2020-07-09 15:39 ` Gerrit Kuehn
2020-07-09 15:44 ` Tamer Higazi
2020-07-09 16:05 ` Simo Tukiainen
2020-07-09 17:25 ` Jarry
2020-07-09 17:32 ` Jack
2020-07-09 17:37 ` Matt Connell (Gmail)
2020-07-09 17:49 ` Jarry
2020-07-10 8:26 ` Alan Mackenzie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox