PDFsharp & MigraDoc Foundation

Update pdf befor print
Page 1 of 1

Author:  monmsirt [ Thu Oct 12, 2017 2:44 pm ]
Post subject:  Update pdf befor print

I've created a pdf with a textfield containg information.
I need to updated this textfield with the current date and time just before print document.

I'm able to add javascript to update info when document is opend in this way

PdfDictionary additionalDictionary = new PdfDictionary(this.pdfDocument);

additionalDictionary.Elements["/S"] = new PdfName("/JavaScript");
additionalDictionary.Elements["/JS"] = new PdfString(PrintUpdateScript);

this.pdfDocument.Internals.Catalog.Elements["/OpenAction"] = PdfSharp.Pdf.Advanced.PdfInternals.GetReference(additionalDictionary);

How can I do the same before print document?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group