PDF Conversion Issues

How to Save a PDF Page as a JPG Using VBA and Adobe Acrobat

Steve KSteve K Nov 3, 2026 869 views

Question details

The user wants to automate saving a specific PDF page as a JPG image using a VBA script in conjunction with Adobe Acrobat.

How to Save a PDF Page as a JPG Using VBA and Acrobat
Product
VBA / Adobe Acrobat
Device & OS
not provided
Scenario
Developing an automation script in VBA (e.g., via Excel or Access) to process PDF files and extract or save their pages as JPG images.
Observed behavior
The standard Acrobat Save method successfully handles PDF document saving but fails when the user attempts to specify JPG as the output format type.
Before you start

Ensure you have Adobe Acrobat Pro installed, as Adobe Acrobat Reader does not support the necessary export APIs. You must also enable the Acrobat library references in your VBA editor.

Solution 1Recommended

Use the Acrobat JavaScript Object (JSObject) in VBA

Since Acrobat's standard VBA Save method does not support image export, you can bridge VBA to Acrobat's internal JavaScript engine to utilize the JS SaveAs method.

Acrobat's core Object Linking and Embedding (OLE) API is limited in direct file conversion types. However, Adobe exposes a JavaScript Object (JSObject) to external applications. By calling this object in VBA, you can access the Acrobat JavaScript 'SaveAs' method, which supports converting pages to 'com.adobe.acrobat.jpeg'.

1
Initialize the Acrobat Application and Document Objects

Open your VBA editor, create an Acrobat Application object (`AcroApp`), and load the target PDF file using the `AcroPDDoc` object.

2
Access the JSObject

Retrieve the JavaScript bridge by declaring a generic Object variable and assigning it the document's JSObject (e.g., `Set jso = pdDoc.GetJSObject`).

3
Execute the JavaScript SaveAs Method

Invoke the `SaveAs` command through the JSObject. You must pass two arguments: the destination file path (with a .jpg extension) and the conversion identifier `"com.adobe.acrobat.jpeg"`.

4
Close and Release Objects

Once the export completes, close the PDF document without saving changes and properly set your VBA object variables to 'Nothing' to free up system memory.

Use the Acrobat JavaScript Object (JSObject) in VBA
Syntax Requirement: When formatting the file path for the JSObject, ensure that you convert standard Windows backslashes (\) to forward slashes (/) to comply with Acrobat's JavaScript path requirements.
Easy PDF to Image Conversion

Convert PDF to JPG Seamlessly with WPS Office

Skip complex VBA scripting and Acrobat API limitations. WPS Office includes a powerful, built-in PDF to Picture tool that lets you export high-quality JPGs from your PDF documents without writing a single line of code.

  1. 1. Open your PDF: Launch WPS Office and open the PDF document you wish to convert.
  2. 2. Access the Tools Menu: Navigate to the 'Tools' tab located on the top ribbon of the WPS PDF interface.
  3. 3. Select PDF to Picture: Click the 'PDF to Picture' button to open the export dialogue window.
  4. 4. Configure Output Settings: Choose 'JPG' as your desired output format. You can also adjust the image quality, watermark settings, and select specific pages.
  5. 5. Export Images: Click 'Export' to immediately save your PDF pages as individual JPG files to your chosen folder.
No coding or VBA script setup requiredHighly compatible with all standard PDF formatsBatch convert multiple pages to high-resolution JPGs easilyLightweight alternative to heavy Adobe installations
microsoft office alternative - wps office

Frequently Asked Questions

Why does the standard Acrobat Save method fail for JPGs in VBA?

The core OLE automation object for Acrobat (`AcroPDDoc`) was primarily designed for PDF manipulation and structural saving. It does not inherently load the image conversion plugins required to output a JPG, which is why you must route the request through Acrobat's internal JavaScript engine.

Can I export multiple PDF pages to JPG using the JSObject in VBA?

Yes. When you use the JavaScript 'SaveAs' method on a multi-page PDF document, Acrobat automatically exports all pages. It appends a sequential number to the base filename you provide (e.g., output_1.jpg, output_2.jpg).

What is the correct conversion identifier for PNG format in Acrobat JavaScript?

If you wish to save the PDF page as a PNG instead of a JPG, you should replace 'com.adobe.acrobat.jpeg' with 'com.adobe.acrobat.png' in the JSObject SaveAs arguments.

Do I need Adobe Acrobat Pro to use these VBA scripts?

Yes. Adobe Acrobat Reader does not include the OLE automation API or the necessary document manipulation libraries required to save PDFs in alternate formats via VBA.