convert
Convert an uploaded document payload with TweekIT.
The file must already be base64 encoded (see blob). The conversion can be
resized and cropped by providing optional geometry parameters. For raster
outputs, set alpha/bgColor to control transparency handling.
Args:
inext: Source file extension such as pdf, docx, or png.
outfmt: Desired output format (Fmt in the API body).
blob: Base64 encoded document payload (DocData).
apiKey: TweekIT API key (ApiKey header). Falls back to TWEEKIT_API_KEY env var.
apiSecret: TweekIT API secret (ApiSecret header). Falls back to TWEEKIT_API_SECRET env var.
noRasterize: Forwarded to TweekIT to skip rasterization when possible.
width: Optional pixel width to request in the output.
height: Optional pixel height to request in the output.
x1: Left crop coordinate in source pixels.
y1: Top crop coordinate in source pixels.
x2: Right crop coordinate in source pixels.
y2: Bottom crop coordinate in source pixels.
page: Page number to extract for multipage inputs.
alpha: Whether the output should preserve alpha transparency.
bgColor: Background color to composite behind transparent pixels.
Returns:
A FastMCP Image or File payload, or an error description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x1 | No | Left crop coordinate in source pixels. | |
| x2 | No | Right crop coordinate in source pixels. | |
| y1 | No | Top crop coordinate in source pixels. | |
| y2 | No | Bottom crop coordinate in source pixels. | |
| blob | Yes | Base64 encoded document payload (DocData). | |
| page | No | Page number to convert for multi-page inputs. | |
| alpha | No | Preserve alpha transparency when producing raster formats. | |
| inext | Yes | Input file extension (e.g., pdf, docx, png). | |
| width | No | Optional pixel width for the converted output. | |
| apiKey | No | TweekIT API key passed via the ApiKey header. Defaults to the TWEEKIT_API_KEY environment variable when omitted. | |
| height | No | Optional pixel height for the converted output. | |
| outfmt | Yes | Requested output format to send as Fmt. | |
| bgColor | No | Background color (hex RGB) to composite behind transparent pixels. | |
| apiSecret | No | TweekIT API secret paired with the apiKey. Defaults to the TWEEKIT_API_SECRET environment variable when omitted. | |
| noRasterize | No | Forward to TweekIT to disable rasterization when supported. |