/pdf-api-python

Creating pdf in python as api

Primary LanguageC++

PDF API PYTON

This API uses POST request to communicate and HTTP response codes to indenticate response and error. All requests must include a content-type of application/json and the body must be valid JSON.

Dependence

pip install pdfkit

wkhtmltopdf

Response Codes

200: Success
500: Server Error

Example Error Message

http code 500
{
    "error"     : true,
    "response"  : "Message error",
}

Request:

POST /pdf HTTP/1.1
Accept: application/json
Content-Type: application/json
{
    "content": "<h1>Hellow world</h1>"    
}

Successful Response:

HTTP/1.1 200 OK
Server: My RESTful API
Content-Type: application/pdf
Query key Description
content html content
url page url
options reference