openapi: 3.0.0 servers: [] info: description: >- :pdf: This is a PDF Server that allows the conversion of a HTML document into a PDF using the chromium engine and puppeteer version: 1.0.0 title: Swagger OPG PDF Generator termsOfService: 'http://swagger.io/terms/' contact: email: '' license: name: MIT url: 'https://opensource.org/licenses/MIT' tags: [] paths: /generate-pdf: post: tags: - pdf summary: Generate PDF from HTML Document description: >- Allows you to pass a HTML document as a string into the endpoint and return a application/pdf document operationId: generate-pdf parameters: - $ref: '#/components/parameters/StripAnchorTags' - $ref: '#/components/parameters/EmbedRemoteImages' - $ref: '#/components/parameters/MarginTop' - $ref: '#/components/parameters/MarginBottom' - $ref: '#/components/parameters/MarginLeft' - $ref: '#/components/parameters/MarginRight' - $ref: '#/components/parameters/Title' - $ref: '#/components/parameters/Subject' - $ref: '#/components/parameters/PrintBackground' - $ref: '#/components/parameters/EmulateMediaType' responses: '200': $ref: '#/components/responses/200Success' '500': $ref: '#/components/responses/500Error' security: [] deprecated: false requestBody: required: true content: text/html: schema: {} description: HTML document to render to a PDF /health-check: get: tags: - healthcheck summary: Check status of PDF Service description: >- Check the status of the PDF Service to ensure the process is running operationId: health-check parameters: [] responses: '200': $ref: '#/components/responses/200SuccessHealthCheck' '500': $ref: '#/components/responses/500ErrorHealthCheck' security: [] deprecated: false externalDocs: description: See OPG PDF Service git repository url: 'https://github.com/ministryofjustice/opg-pdf-service/main/README.md' components: schemas: HeaderValidation: type: object properties: boolean-false: format: '{true|false}' description: boolean with a default of false type: boolean default: 'false' pixels: format: '^[0-9]+$' description: Pixel value as an integer type: integer string: format: '' description: String value type: string emulate-media: format: '{screen|print}' description: Media value type. screen or print. type: string default: print parameters: StripAnchorTags: name: strip-anchor-tags in: header description: Strip all anchor tag hrefs from links on page. required: false schema: type: boolean items: $ref: '#/components/schemas/HeaderValidation/properties/boolean-false' EmbedRemoteImages: name: embed-remote-images in: header description: Downloads images with a remote url and embeds them as base64 encoded data required: false schema: type: boolean items: $ref: '#/components/schemas/HeaderValidation/properties/boolean-false' MarginTop: name: margin-top in: header required: false schema: type: integer items: $ref: '#/components/schemas/HeaderValidation/properties/pixels' description: Set the top margin in pixels of the PDF MarginBottom: name: margin-bottom in: header required: false schema: type: integer items: $ref: '#/components/schemas/HeaderValidation/properties/pixels' description: Set the bottom margin in pixels of the PDF MarginLeft: name: margin-left in: header required: false schema: type: integer items: $ref: '#/components/schemas/HeaderValidation/properties/pixels' description: Set the left margin in pixels of the PDF MarginRight: name: margin-right in: header required: false schema: type: integer items: $ref: '#/components/schemas/HeaderValidation/properties/pixels' description: Set the right margin in pixels of the PDF Title: name: title in: header required: true schema: type: string items: $ref: '#/components/schemas/HeaderValidation/properties/string' description: >- The title of the document that should be added for accessibility purposes. Subject: name: subject in: header required: true schema: type: string items: $ref: '#/components/schemas/HeaderValidation/properties/string' description: >- The subject that should be added for accessibility purposes that describes the intent of the document PrintBackground: name: print-background in: header required: false schema: type: boolean items: $ref: '#/components/schemas/HeaderValidation/properties/boolean-false' description: >- Whether the PDF renderer should include background images when rendering the PDF. EmulateMediaType: name: emulate-media-type in: header required: false schema: type: string items: $ref: '#/components/schemas/HeaderValidation/properties/emulate-media' description: >- Set whether the PDF renderer should use the print or screen CSS for styling responses: 200Success: description: Successfully returned a PDF content: application/pdf: schema: type: string format: binary headers: Content-Disposition: schema: type: string description: Used only with `application/pdf` responses example: attachment; filename="download.pdf" 500Error: description: Internal Server Error content: application/json: schema: type: object properties: message: type: string 200SuccessHealthCheck: description: OK content: application/json: schema: type: string format: binary 500ErrorHealthCheck: description: There is a problem with the service content: application/json: schema: type: object properties: message: type: string links: {} callbacks: {} security: []