Live data from Hacker News

Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

news.ycombinator.com

11–20 of 37 posts

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#11
post #9

Simple layout and fast loading time: big plus. I think the copy could be better. Put more focus on the strengths. Don't use the link-blue color if it isn't a link. About the PDF results: I get mobile versions of websites a lot, but I guess in normal use cases you won't even request those.

Thanks a lot for the constructive feedback. Noting them in down my priority list.

You're right, the most common use case would be that a client sends HTML instead of an URL to the endpoint. This way a PDF can be created of data that's not publicly exposed on the internet (think invoices, contracts, etc.)

I also don't store any of the data you send to the API, as to not further contribute to your GDPR nightmares.

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#12
post #6

I don't know much about the complexities of this task so excuse my question if it's too obvious. How is it different/better than using puppeteer? If it's better, maybe SxS comparisons of generated pdfs could be a good selling point.

Thanks for leaving a comment, really appreciate it. The idea of creating a comparison between PDFs rendered with different solutions is genius. Definitely gonna add this.

Puppeteer would indeed come close in rendering quality. Improvements of using my solution over puppeteer are:

1) I tweaked Chrome headless to have the fonts available to ensure that typography renders as it should. Even emojis work!

2) you don't need to worry about installing and maintaining puppeteer and Chrome headless into your own infra

3) I didn't really make this very clear on my landing page so far, but I'll provide support to clients that have issues getting a certain document to render exactly like they want.

4) Not really a benefit yet since I wanted to launch with the MVP but soon I'll offer several options in the API that puppeteer itself doesn't offer such as multi-document PDFs, automated clickable terms of content for longer documents, etc.

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#13
I literally just built this for rendering invoices etc yesterday.

I ended up using wktohtml on AWS Lambda. Wktohtml isn’t nearly as nice as Princexml or headless Chrome, but for the most part it gets the job done.

What did you end up using for your stack?

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#14

I literally just built this for rendering invoices etc yesterday. I ended up using wktohtml on AWS Lambda. Wktohtml isn’t nearly as nice as Princexml or headless Chrome, but for the most part it gets the job done. What did you end up using for your stack?

That's a coincidence :) I used wkhtmltopdf in the past as well but it struggled when dealing with more complex layouts.

My stack is a tweaked Chrome headless on Linux in a docker container, exposed by a Node API.

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#16
post #15

Ha! I recently launched an analogous service for converting CSVs into Excel files so that web sites can offer users rich spreadsheet downloads instead of crummy CSV files -- goodgrids.com. I posted it to Show HN and just found this! This is great.

Just checked your landing page, great job at making the advantages of your service crystal clear. And of course congrats on launching, always scary to show your baby to the world.

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#18

I tried generate PDF on the landing page and get a 422 error.

What URL did you try to generate a PDF from? The PDF APi replies with a 422 when it can not connect to the requested URL.

This could have a few reasons, the most common one would be if the site you want to generate a PDF for blocks connections from an AWS ip-range.

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#19
I like it! I'm about to release a related service soon so I'm interested in this space.

It's very fast! Are you caching at all?

Since people probably want to use this with private data, would they usually be sending HTML strings to you, vs URLs?

Why's the "i" in API lower case?

Re: Show HN: ThePDFApi, a Chrome Based PDF Generation API Hosted on AWS

#20

I like it! I'm about to release a related service soon so I'm interested in this space. It's very fast! Are you caching at all? Since people probably want to use this with private data, would they usually be sending HTML strings to you, vs URLs? Why's the "i" in API lower case?

Thanks a lot for the feedback.

I'm not caching at all since I do not want to store any potential confidential data on my servers. The main reason that it's fast is that there are several instances running Chrome headless behind a load balancer.

The main use case would indeed be to send HTML to the API instead of an URL. I just didn't add this use case to the landing page API tester, but it's definitely supported.

The i in APi is lowercased because I thought it looked cute :)

Post reply on HN