0

I want to print dynamic year using JavaScript, which works fine on the HTML documents, but when they are published for PDF, the year is not displaying.

I am using a software called MadCap Flare, which is a help file generation tool.

Below is my code that I have used.

<p>© <script type="text/javascript">document.write(new Date().getFullYear())</script><a class="copy" href="#" target="_blank">Abc</a>. Trademarks.</p>

I have referred to the below Stackoverflow question.

Shortest way to print current year in Javascript

It works perfectly fine when the HTML are tested on browsers, but they are not printing on PDF.

Community
  • 1
  • 1
Nitesh
  • 15,425
  • 4
  • 48
  • 60
  • The important piece of information is how you are publishing for PDF. I doubt that the PDF generator executes javascript. – Popnoodles Jun 06 '14 at 12:26
  • I am using a software called MadCap Flare, which is a help file generation tool. So I am creating my HTML documents, which can be published for PDF as well. The same script is getting executed, when I am using a generic footer on all the PDF files, but this file is coming from an HTML file that I have created and strangely it is not working. If it was not understanding execution, it would have not printed the same on footer. - @Popnoodles – Nitesh Jun 06 '14 at 12:30
  • What are you using to create the PDF not the HTML? – Popnoodles Jun 06 '14 at 12:37
  • The same software, Madcap Flare - @Popnoodles – Nitesh Jun 06 '14 at 12:38
  • Check Madcap Flare support to see if their PDF generator parses javascript. I doubt it does. – Popnoodles Jun 06 '14 at 16:40

0 Answers0