Rank: Newbie
Groups: Registered
Joined: 4/7/2021(UTC) Posts: 3 
|
Hello, Is it possible to add annotation with automatically renewed date value on PDF file page using PDFium.NET? Here is an example PDF file I'd like to create:  Overlay_with_autodate.pdf (14kb) downloaded 4 time(s).Mikhael
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,035
Thanks: 5 times Was thanked: 122 time(s) in 119 post(s)
|
Hi,
I am assuming JS is being used. https://pdfium.patagames.com/help/html/WorkingSDK_Actions.htm
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 4/7/2021(UTC) Posts: 3 
|
Hello Paul,
Thank you for this info! Now I'm able to add JavaScript to PDF file (see my code snippet below).
But I need to be able to add PdfWidgetAnnotation, that shows date this Java script calculate. Do you have any idea where can I see code example for this task?
Mikhael
Using doc = PdfDocument.Load(sSrcPDF, New PdfForms()) Dim action = New Actions.PdfJavaScriptAction(doc, "var f = this.getField(""date"");"" & vbCrLf & ""f.value = util.printd(""dd/mmmm/yyyy"",new Date());")
Dim tree = New Wrappers.PdfNameTreeCollection(doc, "JavaScript") tree.Add("Action_CreateAnnotation", action.Dictionary) doc.Save(sDstPDF, SaveFlags.NoIncremental) End Using
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close