Jump to content

Converting pages to pdf – any new modern ways?


a-ok
 Share

Recommended Posts

Is there a modern way to create PDF on the fly these days with the data from PW? mPDF seems fairly old school and only supports tables etc but was looking for something that supports flexbox/css grid etc. I could just use a print stylesheet but it needs to download a PDF, ideally, on click.

Any thoughts?

I've had a look at RockPdf and Pages2Pdf but wondered if there was anything else?

Thanks!

Rich

  • Like 1
Link to comment
Share on other sites

3 minutes ago, dragan said:

Well, if you have the budget, you could use one of the commercial services out there which have an API.

This article suggests using Chrome in headless mode, but I have no idea how difficult it is to install, and what the server requirements are:

Thanks @dragan – I tried to find some decent APIs but couldn't find anything decent... are you aware of any?

And yes I was looking at the headless Chrome stuff too but was quickly confused haha!

Link to comment
Share on other sites

I was also looking to see if I could do it with JSON so output the data using PW to JSON then supplying that either to an API or plugin...

Link to comment
Share on other sites

I used PDFLayer (https://pdflayer.com/) recently in a project, and it did a good job of rendering some quite complex CSS.

It's free to sign up for an api and you get 100 api calls/month with the free version.  It could get expensive though if you have a lot of API calls to make (e.g. $9.99/month for 1000 api calls, $39.99 for 10,000).

It was quite straightforward to use though, and you can set it to "test" mode for development, where it will overlay "Sample" on the PDF output, but not use any of your API requests.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...