HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Stop displaying dynamic data when user saves the document
- This topic has 12 replies, 3 voices, and was last updated Jun 17, 2013
13:38:32 by Anonymous.
-
AuthorPosts
-
April 10, 2013 at 10:19#26836
I’m using pd4ml 3.8fx3 version to convert html files to pdf file. I have a form field in the pdf which will automatically display 1st date of the current month every time pdf is Opened.
I Used the below method to assign javascript which assigns date whenever pdf is opened.
public void addDocumentActionHandler( String actionType, String javaScript );pd4ml.addDocumentActionHandler(“OpenAction”, javaScriptString);
Now we want to stop displaying the dynamic date when user saves the pdf.
Question :
Do we have any action type defined when user saves the pdf? for Opening a file we have “OpenAction” Similarly is there any action type defined when user Saves the pdf?April 10, 2013 at 13:33#29303The first parameter (actionType) of the method accepts the following values:
“OpenAction”,
“DC” (document close),
“WS” (will save),
“DS” (did save),
“WP” (will print)
“DP” (did print)Obviously you are interested in “WS”. However, I suspect, it is going to be tricky to implement the needed functionality with it (or I overcomplicate the things).
You still may try to implement the feature with “OpenAction”. Just compare the document creation date and last modification date (if any and if possible), and display the last modification date if it is greater than the creation date.
April 15, 2013 at 13:40#29304Hi, Thanks for the information. However i tried using “WS” (will save) and
“DS” (did save) option nothing worked. Below is the peace of code used to check the functionality.pd4ml.addDocumentActionHandler(“WS”, “this.getField(‘i1′).value =’kkkk’;”);
pd4ml.addDocumentActionHandler(“DS”, “this.getField(‘i1′).value =’datasaved’;”);When i tried saving pdf using file -> SaveasCopy menu option the form field is not populated with neither of the above mentioned values.
PLease let me know how can i accomplish this.
April 15, 2013 at 13:43#29305Do you use Acrobat Reader or Acrobat to save PDFs?
April 17, 2013 at 12:18#29306I use Adobe reader 9.5 version
April 17, 2013 at 12:31#29307I am afraid, Reader cannot save edited copies of PDF. Well, it can save annotations to PDF, but collected PDF form data can be only exported as FDF. Please correct me if I am wrong.
April 19, 2013 at 06:21#29308Hi, We are not editing the PDF. We have created a form field in html and after converting html to pdf we are populating the form field with first date of the current month dynamically using javascript when ever pdf is opened. This is working fine.
If user saves the pdf document we want the form field to be populate with the date when pdf is saved .
In simple terms we want the pdf form field to populate dynamic date when ever pdf is opened and till the pdf is saved locally .
Plz correct me if my approach is wrong.
April 23, 2013 at 10:28#29309Hi,
Please provide your response on my earlier approach ? If my approach is not correct please let me know how can i implement this.April 23, 2013 at 14:44#29310We need 1-2 days to learn/reproduce PDF-saving specific issues. I’ll let you know.
May 3, 2013 at 09:25#29311Please let me if there are any updates on this issue.
May 8, 2013 at 18:09#29312I created an HTML with 3 text input fields: t1, t2 and t3.
[language=xml:rrtngbnu]
Hockey is among the
oldest
Olympic
sports, having made its first appearance at the 1908 London Games.
[/language:rrtngbnu]Added 3 PD4ML API calls:
[language=java:rrtngbnu]pd4ml.addDocumentActionHandler(“OpenAction”, “this.getField('t1').value ='OpenAction'; app.alert('OpenAction');”);
pd4ml.addDocumentActionHandler(“WS”, “this.getField('t2').value ='WS'; app.alert('WS');”);
pd4ml.addDocumentActionHandler(“DS”, “this.getField('t3').value ='DS'; app.alert('DS');”);[/language:rrtngbnu]Result of a saving of the document is predictable: only t1 and t2 fields are filled. See attached.
However it is some strange: both WS and DS alerts are popped up after I pressed Save of a SaveFile dialog.
May 17, 2013 at 10:32#29313HI, thanks for the reply.
I’m using adobe reader . I have downloaded temp64.pdf and when i open this i see only t1 and t2 fields are filled along with openaction alert. After this i tried saving the temp64.pdf by clicking file -> Save a copy option. i didn’t get any of “WS” or “DS” alert. but i got an alert “Save a blank copy of this Form” . After clicking save a blank copy the pdf copy is saved but with the same information.Please let me know if we can work this on adobe reader. If not what is the alternative.
June 17, 2013 at 13:38#29314Hi,
I’m waiting for reply. Request you top please provide your response. -
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.