Skip to content

Latest commit

 

History

History
99 lines (53 loc) · 1.53 KB

README.md

File metadata and controls

99 lines (53 loc) · 1.53 KB

barberry-pdf

Pdf hosting service on base of Barberry library

Installation

composer.phar install

Uploading an pdf

Request

POST /
Content-Type: multipart/form-data;

... pdf ...

Response

HTTP/1.1 201 Created
Content-Type: application/json

{"id":"FTKLUP","contentType":"application\/pdf","ext":"pdf","length":33807,"filename":"sample.pdf"}

Getting an pdf

To get an original pdf just request it by ID.

Request

GET /FTKLUP

Response

HTTP/1.1 200 OK
Content-Type: application/pdf

... original pdf ...

To convert pdf into jpeg request it by ID and extension.

Request

GET /FTKLUP.jpg HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type:image/jpg

... first pdf page as image width 800 ...

To convert pdf into jpeg with specific width request it by ID + param and extension.

Request

GET /FTKLUP_1000p.jpg HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type:image/jpg

... first pdf page as image width 1000 ...

To convert specific pdf page into jpeg request it by ID + param and extension.

Request

GET /FTKLUP_p2.jpg HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type:image/jpg

... second pdf page as image width 800 ...

To convert specific pdf page into jpeg with specific width request it by ID + param and extension.

Request

GET /FTKLUP_1000p2.jpg HTTP/1.1

Response

HTTP/1.1 200 OK
Content-Type:image/jpg

... second pdf page as image width 1000 ...