Change title on PDF viewer

Change title on PDF viewer

faizalkamaruddinfaizalkamaruddin Posts: 5Questions: 3Answers: 0

Hi everyone,

I want to do a small changes on my PDF viewer. I want to change the title on PDF. I noticed that the title on the PDF following title on the website, but how we can edit the title on the PDF viewer without change title in our website?

Can see on image below. Now the title is "Bikebulance Admin Panel". but I want to change the title to "Cash Sale"

Thank you!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,099Questions: 1Answers: 10,393 Site admin
    Answer ✓

    Use the title option of the pdfHtml5 button type.

    Allan

  • faizalkamaruddinfaizalkamaruddin Posts: 5Questions: 3Answers: 0

    thanks @allan :)

  • pinchy44pinchy44 Posts: 3Questions: 0Answers: 0

    Hi everyone,

    How can I change title dynamically ?

    I have add a textarea field with id #dt-title in my page

    I change the Datatables print button title value to this but don't working dynamically ?

    buttons: [
      {
        extend: 'print',
        text: 'All',
        title: function( thead, data, start, end, display ) {
          $('#dt-title').bind(
            'input propertychange',
            function() {
              return $('#dt-title').val();
            }
          )
        }
      }
    ]
    
  • allanallan Posts: 63,099Questions: 1Answers: 10,393 Site admin

    You can give title as a function as you have done (although it doesn't take any parameters).

    Just return the value that you want to display from that function.

    Allan

  • pinchy44pinchy44 Posts: 3Questions: 0Answers: 0
    edited January 2017

    Thank you,

    I have done like this

    buttons: [
      {
        extend: 'print',
        text: 'All',
        title: function () { return $('#dt-title').val(); },
      }
    ]
    
This discussion has been closed.