1

I have a program that calls a PDF when a button is clicked. That PDF is located in the Resources folder and I'm using this code to show the PDF. System.Diagnostics.Process.Start(Application.StartupPath & "\Resources\MYPDF.pdf")

How can I add a time stamp on my PDF showing the time when it was generated?

elvinguitar
  • 149
  • 3
  • 6
  • 15
  • How are you creating the PDF? If you are generating it anyways using some method, why can't you add a timestamp in this logic? – Jens Feb 18 '14 at 13:04
  • Sorry, wrong term. I mean calling instead of generating. Actually, the PDF is already created, I'm just calling it. By the way, do you know how can I generate a PDF? I mean like I already have a template and the content of that will be based on my results. – elvinguitar Feb 18 '14 at 13:10
  • 1
    Ok, I added an answer that links to a good library I have used before. – Jens Feb 18 '14 at 13:19

1 Answers1

2

Implementing the PDF format yourself is probably a bit out of scope. But there are libraries like ItextSharp for it. You can also use this to edit a pdf and add a string. I can't explain completely how in this context here, but there is documentation and tutorials.

ITextSharp is located at http://sourceforge.net/projects/itextsharp/

Jens
  • 6,275
  • 2
  • 25
  • 51
  • See this separate question that asks pretty much your question and provides code for ItextSharp: http://stackoverflow.com/questions/3992617/itextsharp-insert-text-to-an-existing-pdf – Jens Feb 18 '14 at 14:01