Live data from Hacker News

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

news.ycombinator.com

31–37 of 37 posts

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

#31
As this is a developer-oriented product then I would like to see API documentation. Also, in my opinion, the pricing is a bit hidden at the moment.

I have a similar API product for generating PDFs, we saw that the generation part is easy, it gets crazy when your customers start asking the customizations for their labels, invoices, packing slips, contacts etc.

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

#32

A warning from my own experience: do not use web technologies for any printing (including rendering to pdf) where positioning is critical (e.g. for filling out pre-printed forms). Fiddling with `@media print {…}` and `position: absolute` will work… until there's some minor change in the rendering engine that will throw all that careful work into disarray and leave you asking questions like, "why is this right-aligned…

Could you go into more detail about why printing a web page doesn't do what you want? You mean for example different versions of Chrome would screw up your previously working layout? How about between the same browser on different operating systems?

I've looked into JS libraries that will directly generate PDFs you can print but each library seems to come with a lot of caveats.

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

#33
Since there is no contact form on the site, I figure I'll ask here. How well does it manage different margins on each page? ex Cover page with no margins, but rest of document with margins. Does it support Table of Contents and page numbers? What about other features like JS running in the page header/footer components?

Edit: Holy hell, was just reading some more comments mentioning the price and then had a second look. $79 bucks a month for 10 PDFs. Yeah I think I'm gonna go with spending 10 minutes writing a WebAPI to access my PDF generation API. For reference, it took me two days to land on Puppeteer, a day to configure it how I wanted, and costs me $5 a month to do about 50 PDFs per day (not upper limit, that's just how many we need in a typical business day, I don't know what the box is capable of).

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

#34

A warning from my own experience: do not use web technologies for any printing (including rendering to pdf) where positioning is critical (e.g. for filling out pre-printed forms). Fiddling with `@media print {…}` and `position: absolute` will work… until there's some minor change in the rendering engine that will throw all that careful work into disarray and leave you asking questions like, "why is this right-aligned…

Could you go into more detail about why printing a web page doesn't do what you want? You mean for example different versions of Chrome would screw up your previously working layout? How about between the same browser on different operating systems? I've looked into JS libraries that will directly generate PDFs you can print but each library seems to come with a lot of caveats.

Yes, different versions would produce different layouts. Element positions and bounding boxes would change, more so in the horizontal dimension than the vertical. The text itself would be rendered at the proper size though. FWIW Chrome was better-behaved in this regard than Firefox, but even a 10% shift is too much when you need to get text into a specific box that's already been printed.

I didn't bother to check whether the same browser version on different operating systems would produce the same results.

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

#35

A warning from my own experience: do not use web technologies for any printing (including rendering to pdf) where positioning is critical (e.g. for filling out pre-printed forms). Fiddling with `@media print {…}` and `position: absolute` will work… until there's some minor change in the rendering engine that will throw all that careful work into disarray and leave you asking questions like, "why is this right-aligned…

What makes this so hard? Why can’t browsers just treat the page size as a viewport? Is the problem dealing with page breaks?

It's simply not part of the problem that browsers exist to solve, so probably not worth spending the engineer-hours to get exactly right. Printing in general is, but they just need to get things onto the page in some approximation of what the page looks like; millimeter-perfect accuracy isn't needed.

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

#36
Generating PDF's from HTML is a huge PITA. I really like what you've done.

re: "is it clear upon viewing the landing page what the product is about?" Yes. I think your landing page copy reads well, but could use a bit of polish. Emphasis how well PdfApi solves common margin and background rendering issues compared to other alternatives.

re: "are there any questions that you have that are not answered on the page" I'm not sure you need to answer all of a users questions, but considering you are targeting startups and developers, I'd focus on building out your API documentation.

re: "would this product provide value to you if your startup needed to generate PDFs" Potentially, but considering your audience (developers/startups) I suspect most of us would tackle the issue locally with a Chrome headless setup.

re: "what would you use instead" I've used the following to generate PDF's from HTML: * Chrome Headless * WKHTMLtoPDF

This is good work. I like what you've done. Build out strong API documentation with multiple code snippets and examples to improve your developer marketing.

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

#37

Do you have a security contact address? Edit : Emailed your contact@brainhashed address.

Now that it has been fixed I'll say the site previous allowed you to enter URLs of the form `file:///etc/passwd`, which were then rendered in the PDF output.

In short arbitrary local file inclusion.

Post reply on HN