Embedding images into PDF files

This operation supports embedding a single image to an area of a page in a PDF file. By default, the image is placed in the foreground layer in the page, centered in the specified area and scaled to fit its longest dimension to the designated area, but preserving its aspect ratio. There are two optional arguments to change the default behavior:

  1. "alignment": "<left|right>, <top|bottom>": specifies a different horizontal/vertical alignment of the image to the area, other than centered;

  2. "layer": "<foreground|background>": embeds an image either to the foreground or background layer of the page. It is set to foreground by default;

The resulting asset is stored to the S3 cloud storage service and the URL is listed in the output. The URL will then be publicly available for one day.


  • Endpoint: POST http://mu3.hp-mu.com/jobs/sync
  • Authorization: BASIC bXVscHA6eGhDdGNxNW9U
  • Accept-type: application/json
  • Content-type: application/json
  • Input schema sample: (For embedding an image to the background layer at coordinates (top = 0pt, left = 0pt, bottom = 200pt, right = 0pt) aligned to the top-right of the area.)
{
    "workflow": [
        {
            "task": "EmbedImage",
            "inputs": {
                "pdf": "https://www.site.com/pdf.pdf",
                "image": "https://www.site.com/img.jpg",
                "page": 1,
                "area": {
                    "bottom": 0,
                    "left": 0,
                    "right": 200,
                    "top": 200
                },
                "aligment": "right, top",
                "layer": "background"
            }
        }
    ]
}
  • Output schema sample:
{
    "id": "54f8addc17d013e858b01470",
    "status": "success",
    "workflow": [
        {
            "task": "EmbedImage",
            "inputs": {
                "pdf": "https://www.site.com/pdf.pdf",
                "image": "https://www.site.com/img.jpg",
                "page": 1,
                "area": {
                    "bottom": 0,
                    "left": 0,
                    "right": 200,
                    "top": 200
                },
                "aligment": "right, top",
                "layer": "background"
            },
            "result": {
                "pdf": "https://mu3.s3.amazonaws.com/123.pdf"
            }
        }
    ]
}