I have two PDFs from two different sources that are exactly the same size. I want to overlay one on top of the other.
Output from pdfinfo -box -f 1 -l 3 top.pdf
:
Creator: cairo 1.10.2 (http://cairographics.org)
Producer: cairo 1.10.2 (http://cairographics.org)
Tagged: no
Pages: 1
Encrypted: no
Page 1 size: 419.2 x 594.4 pts
Page 1 MediaBox: 0.00 0.00 419.20 594.40
Page 1 CropBox: 0.00 0.00 419.20 594.40
Page 1 BleedBox: 0.00 0.00 419.20 594.40
Page 1 TrimBox: 0.00 0.00 419.20 594.40
Page 1 ArtBox: 0.00 0.00 419.20 594.40
File size: 1023501 bytes
Optimized: no
PDF version: 1.5
output from pdfinfo -box -f 1 -l 3 bg.pdf
:
Producer: GPL Ghostscript 9.05
CreationDate: Wed May 21 16:00:30 2014
ModDate: Wed May 21 16:00:30 2014
Tagged: no
Pages: 1
Encrypted: no
Page 1 size: 419.2 x 594.4 pts
Page 1 MediaBox: 0.00 0.00 419.20 594.40
Page 1 CropBox: 0.00 0.00 419.20 594.40
Page 1 BleedBox: 0.00 0.00 419.20 594.40
Page 1 TrimBox: 0.00 0.00 419.20 594.40
Page 1 ArtBox: 0.00 0.00 419.20 594.40
File size: 145877 bytes
Optimized: no
PDF version: 1.4
The command I'm using to overlay is: pdftk bg.pdf stamp top.pdf output test.pdf
As you can see from the attached test.pdf the top.pdf is cropped before being stamped onto the image. If I stamp two PDFs from the same source it works without cropping. However all the PDFs are exactly the same size! Any ideas?
http://image.secureweb.ie/pub/bg.pdf
http://image.secureweb.ie/pub/top.pdf
The tools you are using are not the best you could choose. They are giving you false information. I have opened your three files in iText RUPS, and this is what I see:
From left to right, we see:
I would fix the CropBox value before manipulating the PDFs.