News for hackers. Stuff that matters.

marcTPA

Re:Ask HN: Tips for getting your first remote gig? on Friday June 08, 2018 @04:45AM (#17263659)
I'm 100% remote since 5 years now. I rolled into it by relocating and having my biggest client OK'ing me working from abroad. This still seems to be the easiest way to convert to being a remote employee to me, build trust with a company IRL and ask to relocate.

After that contract stopped I applied to about 20 jobs from job boards such as Weworkremotely and Remoteok with the proposition that I could work with them on a freelance base. I got only one callback out of those, did a technical interview and started working with them.

Since then I've switched several times, it gets easier as you build a network of people working remotely that can give you a tip once a position opens up and that will vouch for you.

For the margins there is a global setting in the API that will set the specified margins on the entire document. You can specify additional margins on top of this by setting a margin in css.

Page breaks are controlled by the CSS properties page-break-after, page-break-before and page-break-inside.

Interesting idea, I've been planning to build a save as PDF extension around it as a case study.

Combining the PDF functionality together with an email function sure is interesting, gonna think this over a bit more. Thanks!

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 :)

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.

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.
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.

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.

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.

Thanks for your feedback.

You are right that generating PDFs from HTML and Web Technologies is nothing new. Most existing PHP and node libs sadly don't provide great rendering once you have a document that consists of modern CSS and HTML or modern image formats such as SVG.

Puppeteer would indeed provide the same rendering quality but then you're responsible for the maintenance of the running instances. I'm hoping to make my user's life easier by taking this task out of their hands.

Thank you. Pricing is still experimental, I'm hoping that the easy API interface and the lack of maintenance that my clients would need to do provide a lot more value than the monthly cost.

The stack is Linux on Docker, running a tweaked version of headless Chrome with an API created in Node.

Thanks for the kind words!
A little addendum, I'm also contemplating to create a manual service where you could send me a document in any format (JPG, PSD, Microsoft Word) and I'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.

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.

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

Hello HN!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's based on Chrome. This API will allow a dev to just send the HTML to our API and get a PDF...

( Read More... | 36 comments | 41 points | on HN )