Skip to main content
The following information applies to the legacy Unstructured Partition Endpoint.Unstructured recommends that you use the local-file processing jobs functionality in the Unstructured Pipeline API instead. Unstructured’s local-file processing jobs provide many benefits over the legacy Unstructured Partition Endpoint, including support for:
  • Production-level usage.
  • Multiple local input files in batches.
  • The latest and highest-performing models.
  • Post-transform enrichments.
  • All of Unstructured’s chunking strategies.
  • The generation of vector embeddings.
The Unstructured API also provides support for processing files and data in remote locations.

Task

You want to get, decode, and show elements, such as images and tables, that are embedded in a PDF document.

Approach

Extract the Base64-encoded representation of specific elements, such as images and tables, in the document. For each of these extracted elements, decode the Base64-encoded representation of the element into its original visual representation and then show it.

To run this example

You will need a document that is one of the document types supported by the extract_image_block_types argument. See the extract_image_block_types entry in API Parameters. This example uses a PDF file with embedded images and tables.

Code

For the Unstructured Python SDK, you’ll need: These environment variables:
  • UNSTRUCTURED_API_KEY - Your Unstructured API key value.
  • UNSTRUCTURED_API_URL - Your Unstructured API URL.
Python SDK

See also