TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

41 pointsby marcTPAalmost 7 years ago
Hello HN!<p>It kept surprising me how much of a hassle it is to generate a PDF with decent HTML5 rendering from my SaaS apps. I tried several free libs and APIs but ended up with botched rendering a lot of times. So I set out to simplify this chore by creating an AWS hosted HTML to PDF conversion API that&#x27;s based on Chrome. This API will allow a dev to just send the HTML to our API and get a PDF in response without having to worry about running and managing Chrome somewhere in their infra.<p>I just finished the first version of my landing page and hosted pdf generation API (<a href="https:&#x2F;&#x2F;thePdfApi.com" rel="nofollow">https:&#x2F;&#x2F;thePdfApi.com</a>) and would love to have some feedback on the following points:<p>- is it clear upon viewing the landing page what the product is about?<p>- are there any questions that you have that are not answered on the page? I&#x27;m thinking about adding an FAQ once the first questions pop up.<p>- would this product provide value to you if your startup needed to generate PDFs? If not, what would you use instead?<p>Thanks for helping a fellow hacker out.<p><a href="https:&#x2F;&#x2F;thePdfApi.com" rel="nofollow">https:&#x2F;&#x2F;thePdfApi.com</a>

18 comments

joewilsalmost 7 years ago
Generating PDF&#x27;s from HTML is a huge PITA. I really like what you&#x27;ve done.<p>re: &quot;is it clear upon viewing the landing page what the product is about?&quot; 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.<p>re: &quot;are there any questions that you have that are not answered on the page&quot; I&#x27;m not sure you need to answer all of a users questions, but considering you are targeting startups and developers, I&#x27;d focus on building out your API documentation.<p>re: &quot;would this product provide value to you if your startup needed to generate PDFs&quot; Potentially, but considering your audience (developers&#x2F;startups) I suspect most of us would tackle the issue locally with a Chrome headless setup.<p>re: &quot;what would you use instead&quot; I&#x27;ve used the following to generate PDF&#x27;s from HTML: * Chrome Headless * WKHTMLtoPDF<p>This is good work. I like what you&#x27;ve done. Build out strong API documentation with multiple code snippets and examples to improve your developer marketing.
ertandalmost 7 years ago
I don&#x27;t know much about the complexities of this task so excuse my question if it&#x27;s too obvious.<p>How is it different&#x2F;better than using puppeteer? If it&#x27;s better, maybe SxS comparisons of generated pdfs could be a good selling point.
评论 #17182241 未加载
andreareinaalmost 7 years ago
A warning from my own experience: do <i>not</i> 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&#x27;s some minor change in the rendering engine that will throw all that careful work into disarray and leave you asking questions like, &quot;why is this right-aligned bit of text in an 8.5-inch wide container being printed down the middle of my page?&quot; (the preview looked great btw). Oh, and the vertical scale was only <i>slightly</i> short, so I couldn&#x27;t just scale the page. The right answer in this case was a package that actually spoke pdf and would flow text into a fixed-size box at a fixed location. Oh, and once you&#x27;ve got the file, don&#x27;t let the browser print it either -- somehow both Firefox and Chrome wouldn&#x27;t render it to the printer correctly, and of course they would mess up in different ways.<p>Browsers are good at laying things out on the screen. On paper, not so much.
评论 #17192748 未加载
评论 #17191010 未加载
citrabluealmost 7 years ago
Have you considered offering this as a browser extension? It would greatly increase your market size, and I have worked with (non-technical) people who would love to be able to activate an extension, enter an email address, and email out a PDF (of an invoice) to a colleague.<p>This workflow is a common one, and really frustrating: &quot;Print -&gt; Save as PDF -&gt; choose location on disk&#x2F;google drive&#x2F;dropbox-&gt; Save -&gt; switch to email -&gt; compose email -&gt; enter email address -&gt; enter subject -&gt; add attachment -&gt; navigate to saved location (if I can remember it) -&gt; Send&quot;.<p>You could even add a premium feature that would hit a URL on a schedule, to automate report sending to managers (e.g. of Yahoo Ads or any other platform with similarly terrible reporting).<p>My manager and I at my old place of work used to spend 1-3 hours&#x2F;month, times however many people had access to his credit card for their subscriptions.
评论 #17186227 未加载
smhgalmost 7 years ago
Simple layout and fast loading time: big plus. I think the copy could be better. Put more focus on the strengths. Don&#x27;t use the link-blue color if it isn&#x27;t a link.<p>About the PDF results: I get mobile versions of websites a lot, but I guess in normal use cases you won&#x27;t even request those.
评论 #17182135 未加载
marcTPAalmost 7 years ago
A little addendum, I&#x27;m also contemplating to create a manual service where you could send me a document in any format (JPG, PSD, Microsoft Word) and I&#x27;d create a REST endpoint that you can call with the data that you want to have inserted into the document. The output of this rest endpoint would be the binary PDF data.<p>This way your dev team would not have to invest any time at all in the creation of PDF documents. Shoot me a mail at the email address in my profile if you want to know more.
评论 #17187265 未加载
jexahalmost 7 years ago
Since there is no contact form on the site, I figure I&#x27;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&#x2F;footer components?<p>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&#x27;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&#x27;s just how many we need in a typical business day, I don&#x27;t know what the box is capable of).
eschutte2almost 7 years ago
I like it! I&#x27;m about to release a related service soon so I&#x27;m interested in this space.<p>It&#x27;s very fast! Are you caching at all?<p>Since people probably want to use this with private data, would they usually be sending HTML strings to you, vs URLs?<p>Why&#x27;s the &quot;i&quot; in API lower case?
评论 #17183411 未加载
schappimalmost 7 years ago
I literally just built this for rendering invoices etc yesterday.<p>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.<p>What did you end up using for your stack?
评论 #17182743 未加载
starptechalmost 7 years ago
Generating PDF&#x27;s from HTML and Web Technologies is nothing new. There are tons of PHP and Node.js libs e.g I could host a service in minutes with the help of <a href="https:&#x2F;&#x2F;github.com&#x2F;GoogleChrome&#x2F;puppeteer" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;GoogleChrome&#x2F;puppeteer</a> in only few lines of code. Hosting that service on digital-ocean would reduce the cost to ~5&#x2F;month. Cheers!
评论 #17182110 未加载
taneltahepoldalmost 7 years ago
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.<p>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.
koliberalmost 7 years ago
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.
评论 #17183061 未加载
richjdsmithalmost 7 years ago
Looks good! Pricing is a bit steeper than I&#x27;d expected, but I&#x27;ve also never tried dealing with the pains of trying to generate PDFs. What stack is it built on?
评论 #17182054 未加载
kierenjalmost 7 years ago
This is probably a general headless-Chrome question, but - with something like this, how would you go about specifying margins, page breaks, etc?
评论 #17187526 未加载
ernststavrobalmost 7 years ago
How about not allowing file:&#x2F;&#x2F; URLs?
stevekempalmost 7 years ago
Do you have a security contact address?<p><i></i>Edit<i></i> : Emailed your contact@brainhashed address.
评论 #17199055 未加载
swyxalmost 7 years ago
yes, it looks very nice. i dont have a need to generate pdf&#x27;s unfortunately so i&#x27;m not your target market. good luck. great to productize your side effects.
评论 #17182033 未加载
teddyqwertyalmost 7 years ago
I tried generate PDF on the landing page and get a 422 error.
评论 #17183382 未加载