PDF filename placeholder in PDF Templates

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • leon
    Junior Member
    • May 2019
    • 10

    #1

    PDF filename placeholder in PDF Templates

    It would be great to implement a feature which allows us to determine the name of the Pdf file both for Print to PDF and Send in Email (Sales Pack).

    For Print to PDF I currently have implemented this by changing /application/Espo/EntryPoints/Pdf.php which results in a Pdf filename containing one of our custom fields.

    For Send in Email I have changed /custom/Espo/Modules/Sales/Tools/Quote/EmailService.php with the same result.

    Using the already available Placeholders in PDF Templates would be perfect. Might be even worth it to also allow the same placeholders for the PDF Title (currently only {$name} is allowed).
  • emillod
    Active Community Member
    • Apr 2017
    • 1492

    #2
    Adding it to a Template settings would be great! I think that one of our customers even want to order something like this haha

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1755

      #3
      The filename is created by the name field. I modify the name field by a formula, that generates a more informative (file)name. First I set a default value to the name field like: "this field will be filled automatically", because the name field is mandatory and this way I have it prefilled and it won`t throw an error on saving, as at this point the calculation is not executed yet. Then I create a formuja, which concatenates the desiered field values for the name field, e.g.: invoice with number, recipient of the invoice and date for the invoice. On saving, the concatenated values will be set in the name field.
      The PDF filename then looks: Invoice No. 001/2025 Recipient name and date of invoice.pdf

      Comment

      • emillod
        Active Community Member
        • Apr 2017
        • 1492

        #4
        Yeah, but it doesn't look like a clean solution. It's also possible that user will want to have different names for each template.

        Comment


        • shalmaxb
          shalmaxb commented
          Editing a comment
          Right now, I cannot imagine, how this would not be possible. Let´s say, I have an invoice. Thene the namefield will be concatenatet with the word "invoice".
          I it would be a quote (another entity or even the same entity with conditional configuration, another template), the name would containe concatenated the word "quote".
          I use it in one entity, which is able to print different article lists, each with a template of its own and the filename is adapted by an enum field. List 1 is than named different than list 2.
          Or do I don not get another possible configuration, where this could be a problem? So far it always worked as desired.
      • Kpuc
        Member
        • Nov 2020
        • 42

        #5
        +1 on this feature request... This is a very useful feature that would add a lot to the overall experience.

        Comment

        • 5k18a
          Member
          • Jul 2025
          • 39

          #6
          Oh yes that would be fantastic. I always have to change the file name to date-customerName-DocumentNo.pdf, now the default option is just the document number.
          Last edited by 5k18a; Yesterday, 10:18 AM.

          Comment

          • emillod
            Active Community Member
            • Apr 2017
            • 1492

            #7
            yuri is that something you could add to Espo code? Sounds like a good idea.

            Comment

            Working...