---
title: "Create pdf-file from transforming xml document with Xsl-Fo transform document."
method: POST
path: "/api/pdf/xslfowithtransform"
tags: ["Pdf"]
---

# Create pdf-file from transforming xml document with Xsl-Fo transform document.

`POST /api/pdf/xslfowithtransform`

## Headers

- `X-Api-Version` string

## Request body

- FoTransformRequestDto — The XSL-FO transform document and xml data document as a Base64 encoded string with a set of resources provided with a name and the data of the resource as a Base64 encoded string.
  - `foDocumentBase64String` string, nullable — This is the complete XSL-FO document provided using Base64 encoding.
  - `resources` object, nullable — This is a set of key-value pairs of digital resources like images that is referenced in the XSL-FO document. It uses the filename as key and the data is provided as a Base64 encoded string.
  - `metadata` PdfMetadataDto — Enter meta data for pdf document
    - `title` string, nullable — Pdf document title
    - `author` string, nullable — Pdf document author
    - `subject` string, nullable — Pdf document subject
    - `keywords` string[], nullable — Pdf document keywords
    - `enableAdd` boolean — Enables or disables adding or modifying text annotations and interactive form fields.
    - `enableCopy` boolean — Enables or disables copying of text and graphics.
    - `enableModify` boolean — Enables or disables modifying document contents (other than text annotations and interactive form fields).
    - `enablePrinting` boolean — Enables or disables printing.
    - `ownerPassword` string, nullable — Specifies the owner password that will protect full access to any generated PDF documents.
    - `userPassword` string, nullable — Specifies the user password that will protect access to any generated PDF documents.
  - `xmlDataDocumentBase64String` string, nullable — This is xml data document on which the XSL-FO transform document is applied. Provided using Base64 encoding.

## Response `200`

Returns the newly created pdf file. Either the file directly or serialized as Json if Accept-header is set to application/json

- PdfResponseDto — 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".
  - `errorMessage` string, nullable — If any error occurs the message will be displayed in here
  - `pdfFileBase64String` string, nullable — The Base64 encoded string that is the pdf file.

## Other responses

- `400` — If any error occurs parsing input
- `415` — If content-type of request is not set to multipart/form-data or application/json
- `429` — If you reach the monthly request limit for your subscription plan

---

[API](https://skmtc.net/pdfbroker/apis/pdfbroker-io-api.md) · [All operations](https://skmtc.net/pdfbroker/apis/pdfbroker-io-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/pdfbroker/pdfbroker-io-api/versions/c10982b50857/schema)
