Simple (?) Adobe Acrobat question

Posted by: tanstaafl.

Simple (?) Adobe Acrobat question - 26/08/2008 21:39

I know... every time I ask what I think is a simple question the answers turn out to be so complicated I have a hard time following them. But this one really should be simple.

I have a 15 page document that someone sent me, scanned in and saved as a single file of PDF pages. She had the pages rotated 180 degrees when she scanned them, so they display on my monitor upside down.

Is there a simple way to fix this, other than trying to balance my monitor on its top? I don't think I have any tools that can edit PDF files.

tanstaafl.
Posted by: Robotic

Re: Simple (?) Adobe Acrobat question - 26/08/2008 21:50

I think there's an option to rotate the view of the document.
It might be hidden in a default setup and you'll have to 'customize' the toolbar.

Hmmm... (goes to look)

Yup! You can rotate the view from the 'View' menu in 90 degree increments.
Unfortunately, that only applies to a single viewing of the document- it doesn't change it for the next time you open it.

If you're quick with your keyboard, shft&ctrl&+ or - will rotate the view.
Posted by: gbeer

Re: Simple (?) Adobe Acrobat question - 27/08/2008 01:57

Unless you have the full version of Acrobat. Then you may save it in that orientation.
Posted by: ricin

Re: Simple (?) Adobe Acrobat question - 27/08/2008 16:36

Try this out.
I'm guessing you're in Windows. Just unzip this and run:

Code:
rotatePdf input.pdf output.pdf 180
Posted by: matthew_k

Re: Simple (?) Adobe Acrobat question - 27/08/2008 17:01

This is one of those "it just works" things on a mac. Built into preview, the program used for opening most any standard file, you go to Tools>Rotate Left or Rotate Right, and then save it.

Matthew
Posted by: tanstaafl.

Re: Simple (?) Adobe Acrobat question - 28/08/2008 03:27

Quote:
Just unzip this and run:


That did the trick. Thank you.

I thought I'd be clever and use my "Print to PDF" utility, but that didn't work. I could change the orientation using the "View" tab in Acrobat, but if I selected the Print to File option, Acrobat wouldn't recognize it as valid format, and deselecting the Print to File option saved it as an Acrobat file -- but still inverted.

tanstaafl.
Posted by: Robotic

Re: Simple (?) Adobe Acrobat question - 28/08/2008 03:31

I use PDFCreator, which acts like a printer, but I don't think that I can print a pdf to PDFCreator for some reason.

Glad you worked it out!
Posted by: ricin

Re: Simple (?) Adobe Acrobat question - 28/08/2008 19:52

Just in case anyone wants to do something else with this, here's the hack code...

Code:
import com.lowagie.text.DocumentException;
import com.lowagie.text.pdf.PdfNumber;
import com.lowagie.text.pdf.PdfReader;
import com.lowagie.text.pdf.PdfName;
import com.lowagie.text.pdf.PdfStamper;
import java.io.FileOutputStream;
import java.io.IOException;

public class RotatePages
{
    public static void main(String[] args)
    {
        String fileName = "";
        String outFileName = "";
        int degrees = 0;
        String usage = "usage: RotatePages <input> <output> <degrees>";

        if (args.length > 2)
        {
            fileName = args[0];
            outFileName = args[1];
            try
            {
                degrees = Integer.parseInt(args[2]);
                if (degrees != 90 && degrees != 180)
                {
                    System.out.println("Entered: " + degrees);
                    throw new NumberFormatException();
                }
            }
            catch (NumberFormatException e)
            {
                System.out.println(usage);
                System.out.println("Please specify either 90 or 180 degrees.");
                return;
            }
        }
        else
        {
            System.out.println(usage);
            return;
        }
        try
        {
            System.out.println("Rotating all pages in " + fileName + " by "
                + degrees + " degrees.");

            PdfReader reader = new PdfReader(fileName);

            for (int p = 1; p <= reader.getNumberOfPages(); ++p)
            {
                reader.getPageN(p).put(PdfName.ROTATE, new PdfNumber(degrees));
            }

            PdfStamper stp = new PdfStamper(reader, new FileOutputStream(
                outFileName));
            stp.close();
            System.out.println("Writing " + outFileName + " ...");
        }
        catch (DocumentException e)
        {
            e.printStackTrace();
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
    }
}