output_encoding parameter allows you to specify how the PDF should be encoded in the API response.
Overview
When rendering a PDF synchronously, you can choose how the generated PDF is encoded in the response. Theoutput_encoding parameter lets you specify whether to return raw binary data or a base64-encoded string.
Parameter details
enum<string>
default:"binary"
Specifies how the PDF should be encoded in the API responseAvailable options:
binary, base64Usage
Behavior
binary: Returns the PDF as raw binary data in the response body. This is the default behavior.base64: Returns the PDF as a base64-encoded string in the response body.
Use cases
This parameter is particularly useful for:-
Direct downloads: Use
binarywhen you want to directly download or stream the PDF to the client. -
API integration: Use
base64when integrating with systems that expect base64-encoded data or when you need to include the PDF in a JSON response. -
Browser compatibility: Use
base64when working with JavaScript in browsers where handling binary data might be challenging.