We have two small tasks and would like an API for both. This is for a small web application.
Task 1: Create a thumbnail of the first page of a text document.
Our users can upload documents to a personal online folder. The system creates an icon of the first page of each document they upload, so the user can quickly glance the document when browsing through their online folder. On the screen, the icon is approximately the size of a movie icon on iTunes or Netflix. So the image sizes cannot be distorted but must show the approximate size ratio of the original document and should be of decent image quality.
For pdfs we use the "imagemagick" library (PHP), and this works. But for doc and docx files, it seems this library does not work.
Can you make an API that can handle these file types?
You can write it in Python if there are more or better libraries for this task in Python.
INPUT AND OUTPUT
Input for API no 1 (thumbnails):
input = hyperlink of text document (e.g. pdf, doc or docx) on our server
output = hyperlink to thumbnail on API server, where we will store the thumbnail temporarily
Task 2: Convert hyperlinks of webpages to pdfs that the user can store in their folder
We would like an API that creates high-quality pdfs when offered a link of a webpage on the Internet. An often used library is FPDF for PHP. But since we want an API, you can also write it in Python if there are more or better libraries for this task in Python.
INPUT AND OUTPUT
Input for API no 2 (pdf of webpages):
input = hyperlink to webpage in the Internet;
output = hyperlink to pdf on API server, where we will store the pdf temporarily
The API's should work fast, be accurate and allow scaling for more intensive use.
Please write a short documentation about each API in the code heading