Expand my Community achievements bar.

SOLVED

Saving a pdf without the presaved data

Avatar

Level 2

Hi all. I'm a newbie on LiveCycle and I'm having trouble on saving a pdf without the presaved data.

I'm working a project in which the pdf form must generate a number based on Epoch & Unix Timestamp.

The pdf should generate a number every time a user(s) opened the pdf and when a user decide to close the pdf, a save dialog box should appear.
I successfully created a form using Adobe Acrobat DC Pro but I can't do the same on LiveCycle.


Is there any codes or "Clear form" on LiveCycle before saving to pdf?

sample.pdf - Google Drive

1 Accepted Solution

Avatar

Correct answer by
Level 10

Well, my fault. Once you've entered the code line press [Ctrl]+[Enter].

The populated timestamp in the text field will be deleted und the console returns null.

1354683_pastedImage_0.png

Now you can save the form or Reader-enable it, if you need the save function in Adobe Reader too.

It depends on you Acrobat version, how to to this. In Acrobat XI its under File > Save As > Reader Extended PDF > Enable Additional Features.

View solution in original post

5 Replies

Avatar

Level 10

Well, the problem here is, that you'll have to Reader-enable the forms once but  after that you script won't fire anymore, right?!
The workaround is to reset the field via Acrobat's console before Reader-enabling the form.

  1. Open the form in Acrobat.
  2. Press [Ctrl] + [J] to open the console.
  3. Enter the following line and press [Enter] delete the populated value in the textfield.
    this.xfa.form.form1.resolveNode("#subform[0]").AgreementNo.rawValue = null;
  4. Reader-enable the form.

Avatar

Level 2

I opened up the console but where should I paste the code?

Like this?

1353236_pastedImage_4.png

Avatar

Level 2

I can't seem to make it work, I did put the line and pressed enter but nothing happens. I don't know how to Reader-enabled a pdf so I have a silly question thought I think it's possible, or maybe not.

I'm playing with the document actions; document will close and document will save. I pasted the line that you gave in "doc will close", and bwalah, it worked and I thought I have the pdf that I want but it's not

My question is, is there any javascript codes that I can put on "doc will save" that will remove the code that I put in the "doc will close"? or is this a silly question because I need to reader-enabled the pdf first? If yes, can you give me a thorough guide on how to make that line work? Sorry, I'm fairly new in creating forms in Adobe Acrobat and LiveCycle

Avatar

Correct answer by
Level 10

Well, my fault. Once you've entered the code line press [Ctrl]+[Enter].

The populated timestamp in the text field will be deleted und the console returns null.

1354683_pastedImage_0.png

Now you can save the form or Reader-enable it, if you need the save function in Adobe Reader too.

It depends on you Acrobat version, how to to this. In Acrobat XI its under File > Save As > Reader Extended PDF > Enable Additional Features.

Avatar

Level 2

Thank you for your help radzmar.