7

I have a PDF (generated by PowerPoint) containing 8.5×5.5 inch portrait pages.

I need to convert it to 8.5×11 inch landscape pages where each landscape page contains two copies of the original (smaller) portrait page side-by-side.

In ASCII art:

 Original  |    Desired
           | 
  |---|    |  |---| |---|
  | 1 |    |  | 1 | | 1 |
  | 1 |    |  | 1 | | 1 |
  |---|    |  |---| |---|
           |
  |---|    |  |---| |---|
  | 2 |    |  | 2 | | 2 |
  | 2 |    |  | 2 | | 2 |
  |---|    |  |---| |---|

Is there any free way to do this, or will I need to do it in C#?

0

4 Answers 4

2

"Print" it using pdfcreator (open source virtual printer driver).

//edit: One more option is using pdftk (http://www.accesspdf.com/pdftk/), but I haven't tested it myself.

5
  • I don't see how to duplicate pages in PDF creator (See my ASCII art)
    – SLaks
    Jan 15, 2010 at 2:47
  • Now I tested it. In pdf print dialog I chose to copies and printing multiple pages per sheet. Unfortunately it groups pages instead of putting to copies on thesame page :(. I'm sorry for non tested answer. Jan 15, 2010 at 2:58
  • If I play with collation, it might work. Where did you specify multiple pages per sheet?
    – SLaks
    Jan 15, 2010 at 3:01
  • In print dialog in Acrobat Reader, but unfortunately collate option looks broken for printing multiple pages per sheet. I also set double size in printer properties (properties button print dialog in Acrobat Reader). How about copping slides in PowerPoint? Jan 15, 2010 at 3:05
  • 1
    The slides use multiple masters pages with different formatting. I tried writing a macro to copy them, but I couldn't make it handle the formatting correctly.
    – SLaks
    Jan 15, 2010 at 3:10
4

OK, you solved it by having access to the source file of your PDFs, the Powerpoint file. What could you do if you want to achieve the same thing without access to the sources?

Let me give this a shot. I'll be using...

  1. Ghostscript for placing and shifting the input PDF pages onto the new media size;
  2. pdftk to overlay two different PDF pages onto one.

First step: Ghostscript to place images on larger media

Here is what we want to achieve with the help of Ghostscript in this step:

+-----------+-----------------------+
| Original  |  Ghostscript-output   |
+===========+=======================+
|  +---+    |  +---+---+  (right    |
|  | p |    |  | p |   |   half     |
|  | 1 |    |  | 1 |   |   of sheet |
|  +---+    |  +---+---+   empty)   |
|           |                       |
|  +---+    |  +---+---+  (left     |
|  | p |    |  |   | p |   half     |
|  | 2 |    |  |   | 2 |   of sheet |
|  +---+    |  +---+---+   empty)   |
+-----------+-----------------------+

This is the first command to use:

gswin32c.exe ^
 -o left-side-outputs.pdf ^
 -sDEVICE=pdfwrite ^
 -g7920x6120 ^
 -dPDFSETTINGS=/prepress ^
 -c "<</PageOffset [0 0]>>setpagedevice" ^
 -f powerpoint.pdf

I shifted all page images by... nothing, but placed them on a bigger sheet. I'm too lazy to type and explain all the options needed to select the odd page numbers only, so for now I simply do this for all pages. -- So this is what we did achieve for now:

+-----------------------+
|  Ghostscript-output   |
+=======================+
|  +---+---+  (right    |
|  | p |   |   half     |
|  | 1 |   |   of sheet |
|  +---+---+   empty)   |
|                       |
|  +---+---+  (right    |
|  | p |   |   half     |
|  | 2 |   |   of sheet |
|  +---+---+   empty)   |
|                       |
|  +---+---+  (right    |
|  | p |   |   half     |
|  | 3 |   |   of sheet |
|  +---+---+   empty)   |
|  .........            |
+-----------------------+
 (left-side-outputs.pdf)

Now putting all images to the right:

gswin32c.exe ^
 -o right-side-outputs.pdf ^
 -sDEVICE=pdfwrite ^
 -g7920x6120 ^
 -dPDFSETTINGS=/prepress ^
 -c "<</PageOffset [396 0]>>setpagedevice" ^
 -f powerpoint.pdf

This is what we achieved with the second command:

+-----------------------+
|  Ghostscript-output   |
+=======================+
|  +---+---+  (left     |
|  |   | p |   half     |
|  |   | 1 |   of sheet |
|  +---+---+   empty)   |
|                       |
|  +---+---+  (left     |
|  |   | p |   half     |
|  |   | 2 |   of sheet |
|  +---+---+   empty)   |
|                       |
|  +---+---+  (left     |
|  |   | p |   half     |
|  |   | 3 |   of sheet |
|  +---+---+   empty)   |
|  .........            |
+-----------------------+
 (right-side-outputs.pdf)

Second step: use pdftk.exe to overlay pairs of pages.

In case you haven't installed it yet, download it from here. It doesn't require a real installation. It's an .exe file which runs from every location. We want to make the result look like this:

+---------------------+-------------+
| pdftk input         | pdftk output|
+=====================+=============+
| +---+---+ (right    | +---+---+   |
| | p |   |  half     | | p | p |   |
| | 1 |   |  of sheet | | 1 | 2 |   |
| +---+---+  empty)   | +---+---+   |
|                     |             |
| +---+---+ (left     |             |
| |   | p |  half     |             |
| |   | 2 |  of sheet |             |
| +---+---+  empty)   |             |
+---------------------+-------------+

We will use these commands:

pdftk.exe ^
   A=left-side-outputs.pdf ^
   B=right-side-outputs.pdf ^
   cat A1 B2  ^
   output 2up-powerpoint-page-1.pdf ^
   verbose

pdftk.exe ^
   A=left-side-outputs.pdf ^
   B=right-side-outputs.pdf ^
   cat A3 B4  ^
   output 2up-powerpoint-page-2.pdf ^
   verbose

OK, so far we only created the first two double-up pages... However, I now want to concatenate these two double-pages into a single file:

pdftk.exe ^
  A=2up-powerpoint-page-1.pdf ^
  B=2up-powerpoint-page-2.pdf ^
  cat A B ^
  output 2up-powerpoint-all.pdf

You should now have enough inspiration to process the remaining pages... if you are super-ambitious, you'll even script that with one single commandline, using two nested for /l ... loops ;-)

1
  • If anyone wonders where the 7920x6120 comes from, that is the paper size of the output file in points (this one is for "letter", "a4" would be 8420x5950). Common sizes are listed in the ghostscript doc. I don't know why, but you have to take the value from there times 10.
    – DBX12
    May 22, 2023 at 7:46
1

I solved this by generating a second PowerPoint presentation with two copies of each slide, saving it to PDF, and printing the PDF with two pages per sheet.

0

This can also be done using Python with PyPDF2 https://pythonhosted.org/PyPDF2/index.html

You can see some example code in another post: https://superuser.com/a/1508283/590044

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .