Automatically Rotate PDFs and Convert to Images

Jul 16, 2025·4 Minutes Read

What You'll Have When Done: Drop any PDF into a Google Drive folder and watch it automatically rotate to proper orientation, convert to PNG images (one per page), and save the results to your designated image folder.

Prerequisites

Before you begin, make sure you have:

  • A PDF.co API Key (Get yours here)
  • A Google Drive account with OAuth2 credentials in n8n
  • Two Google Drive folders: one for PDF input, one for image output (Create folders here)
  • An n8n instance (cloud or self-hosted)
  • PDFs that need rotation correction and image conversion (Download Sample here)

Quick Start Options

Option A: I Want It Working Now

  1. Import this workflow template → Download JSON File
  2. Connect your Google Drive and PDF.co accounts
  3. Set up your input and output folders
  4. Test with a sample rotated PDF
  5. Activate and run

Option B: I Want to Build It Step-by-Step

Follow the 6-step guide below to create the automation from scratch.

What This Automation Does (Overview)

  1. Monitors a specific Google Drive folder for new PDF uploads
  2. Automatically rotates PDF pages to correct orientation
  3. Converts each page of the PDF to individual PNG images
  4. Saves all images to your designated Google Drive folder

Step 1: Monitor PDF Upload Folder

Node: Google Drive → Changes Involving a Specific Folder

Settings:

  • Folder From List: Your designated PDF input folder
  • Watch For: File Created

Success Looks Like: The trigger activates immediately when a PDF is uploaded to your watched folder.

Tip: To ensure smooth file access in the next step, set the Google Drive sharing settings to “Anyone with the link”.

Step 2: Auto-Rotate PDF Pages

Node: PDF.co API → Rotate PDF Pages

Settings:

  • PDF URL: {{ $json.webContentLink }}
  • Rotation Mode: Auto (automatically detects and corrects orientation)
  • File Name: {{ $json.name }}

Success Looks Like: PDF.co returns a URL to the rotated PDF with all pages properly oriented. The system automatically detects which pages need rotation.

Note: The auto-rotation feature uses AI to detect text orientation and rotate pages accordingly. Manual rotation options are also available if you need specific angles. To learn more, visit our API Docs.

Step 3: Convert PDF to PNG Images

Node: PDF.co API → Convert from PDF

Settings:

  • PDF URL: {{ $json.url }} (from previous step)
  • Convert Type: PDF to PNG

Success Looks Like: PDF.co returns an array of URLs, one for each page converted to PNG format. Multi-page PDFs will generate multiple image URLs.

Step 4: Split Image URLs into Individual Items

Node: Split Out

Settings:

  • Field to Split Out: body
  • Include: No Other Fields

Success Looks Like: Each PNG image URL becomes a separate workflow item, allowing individual processing and storage of each page image.

Note: This step is crucial for multi-page PDFs as it separates the bulk conversion result into manageable individual files.

Step 5: Download Each Image File

Node: HTTP Request

Settings:

  • Method: GET
  • URL: {{ $json.body }}

Success Looks Like: Each PNG image is downloaded as binary data, ready for storage.

Step 6: Save Images to Google Drive

Node: Google Drive → Upload File

Settings:

  • Input Data Field Name: data
  • Parent Drive From List: My Drive
  • Parent Folder From List: Your designated "Save Images" folder

Success Looks Like: All converted PNG images appear in your Google Drive folder.

Congrats! You've automated the entire PDF processing workflow—from upload to rotation correction to individual page images, all stored and ready for use. Perfect for digitizing documents, creating image archives, or preparing PDFs for further processing.

Built something cool? Share it with us @pdfdotco

Related Tutorials

See Related Tutorials