The 'Extract Images from PDF' Power Automate action enables images to be extracted from specified regions of a PDF document and returns an array of the extracted image files.
Whilst this action is limited to extracting images regions from PDF documents, simply convert files to PDF format using the 'Convert to PDF' flow action prior to executing this action to enable image regions to be extracted from 70+ different files types.
Please refer to the Supported File Types article for a complete list of the different file formats / document types which are supported for PDF conversion.
The default 'Extract Images from PDF' flow action parameters are detailed below:
- Filename: The PDF filename (including file extension)
- File Content: A Base64 encoded representation of the PDF file to be processed.
- Image Regions: An array of Image Regions (See below for further details)
Please refer to the Obtaining the 'File Contents' Parameter article for guidance on how to obtain the 'File Content' parameter ready to provide to an Encodian flow action.
Extract Images from PDF Utility
The 'Extract Images from PDF Utility' utility helps you to automatically generate the JSON data used by the 'Extract Images from PDF' Power Automate action. You can upload and browse a PDF document by selecting the required regions, the utility then automatically generates the JSON which can be passed to the Encodian action.
Image Region Detail
An Image region is specified as a rectangle and is made up of 4 coordinates representing the bottom left of the rectangle on the X and Y axis and the upper right of the rectangle on the X and Y axis.
The origin (0,0) of the coordinate system is in the bottom left-hand corner of the page. Coordinates are specified in points, a typical A4 page is 595 x 842 points.
Image Region - Multiple image regions can be selected in one operation. To create more than one region click the "Add new item" button:
- Image Regions Name: A name for the region that will be used as the filename for the extracted image. If duplicate names are provided, a number will be appended to the end of the name to guarantee uniqueness.
- Image Regions Lower Left X Coordinate: Number of points across from the left-hand edge of the page to the lower left corner of the rectangle
- Image Regions Lower Left Y Coordinate: Number of points up from the bottom edge of the page to the lower left corner of the rectangle
- Image Regions Upper Right X Coordinate: Number of points across from the left-hand edge of the page to the upper right corner of the rectangle
- Image Regions Upper Right Y Coordinate: Number of points up from the bottom edge of the page to the upper right corner of the rectangle.
- Image Regions Page Number: The page number of the PDF from which to extract the image.
- Image Regions Image Type: The required file type of the extracted image, choices are TIFF, PNG, JPG or BMP.
- Image Regions Extract Entire Page: If set to Yes any specified coordinates will be ignored and the entire page will be extracted as an image.
- Image Regions Resolutions: The DPI or the extracted image.
The advanced 'Extract Image from PDF' flow action parameters are detailed below:
- Operation ID: (Advanced) The ID of a parent operation, please refer to Flow Action Return Options: File Content vs. Operation ID
The 'Extract Images from PDF' Power Automate action returns the following data.
Action Specific Return Values
Images- The collection of images extracted from the PDF document supplied
Each document within the documents collection contains the following values:
- Filename - The filename of the image
- FileContent - The file content of the image
Working with the images returned (example)
The following is an example of the JSON payload that is returned in the response.
"Operation Status": "Complete"
Standard Return Values
- OperationId - The unique ID assigned to this operation.
- HttpStatusCode - The HTTP Status code for the response.
- HttpStatusMessage - The HTTP Status message for the response.
- Errors - An array of error messages should an error occur.
- Operation Status - Indicates whether the operation has been completed, has been queued or has failed.