amici-infotech/craft-super-pdf

Control creation of pdfs

Closed this issue · 4 comments

Is there a way to stop pdfs from being created on every page load?

I would prefer to generate the pdf when an entry is saved, that way the page load on the user wouldn't be impacted and I would be using up far less storage space on my server.

Hey. I can surely make some changes on script to do so. It won't generate on entry save. it will generate once on page load and then each time load from cache. (from the asset folder where we will save the pdf)

That doesn't seem to be how it works for me. Every time I visit a page it will create a new pdf in storage/pdf with the specified filename + a 5 digit randomly generated number separated by an underscore. Is it possible that something might be misconfigured in my setup? As far as I can see it is almost an identical setup to the example.

{% set brochureURL =
  craft.superpdf.template(
    'parks/_brochure',
    {
      filename: entry.slug,
      type: 'url'
    },
    {
      entry: entry
    }
  )
%}

I am also having this issue. @rellafella did you have any luck sorting this?

Hey @josh-attwood We are cooking new version inhouse, form next version that will be releasing this or upcoming week, which will gives you ability to turn on override file. So if file exists, it will either not create it or override it according to your settings.