niba291 / pdf-api-python

Creating pdf in python as api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Creating pdf in python as api


Languages

Language:C++ 50.2%Language:C 30.5%Language:Python 15.5%Language:Pawn 3.8%