action pdfbroker_post_api_pdf_wkhtmltopdf {
label: "Generate pdf file from url using the excellent tool wkhtmltopdf."
provider: pdfbroker
method: POST
path: "/api/pdf/wkhtmltopdf"
encoding: json
input: {
type: "object"
description: "WkHtmlToPdfRequestDto is the data transfer object for generating a pdf using wkhtmltopdf;"
properties: {
HtmlBase64String: {
type: "string"
description: "Base64 encoded string with html. If property Url is set, it will be used, not HtmlBase64String."
}
Resources: {
type: "object"
description: "This is a set of key-value pairs of digital resources like images that is referenced in the HtmlBase64String document. It uses the filename including relative path as key and the data is provided as a Base64 encoded string."
}
Url: {
type: "string"
description: "The url to generate pdf from. Url has precedence over HtmlBase64String value if both are set."
}
WkHtmlToPdfArguments: {
type: "object"
description: "Command line arguments passed to wkhtmltopdf."
}
}
additionalProperties: false
}
output: {
type: "object"
description: "When setting the Accept-header in the request to \"application/json\" the content of the pdf file will be return as Base64 encoded string. Note that converting data to Base64 encoded strings increases the response size with approximately 33%, if you can accept the a binary format it's better to use Accept-header \"application/pdf\"."
properties: {
ErrorMessage: {
type: "string"
description: "If any error occurs the message will be displayed in here"
}
PdfFileBase64String: {
type: "string"
description: "The Base64 encoded string that is the pdf file."
}
}
additionalProperties: false
}
}