Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Locking PDF before rendering

Avatar

Level 2

Hi LiveCycle experts,

Let me explain the situation first.

I have fillable PDFs on LiveCycle Forms server.

I was able to find a script block to lock all the fields before submit. The script is in preSubmit event in the submit button.

The submit button is set to submit as XML and I need to save the entire PDF as binary.

So, I converted the XML by rendering the original PDF with submitted XML data as form data and saved the binary and it was successful.

However, since I'm rendering the original fillable PDF (I'm guessing there's no info about field properties when submitted as XML?), the PDF is still fillable when I retrieve the saved binary PDF again.

Is there a way to achieve this?

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Level 10

Does it mean that I don't have it?

Probably.

If so, is there a workaround?

When you submit your XML, you could set a hidden field (let's say true). Then, OnInitialize of the form, check the hidden field, and if it's true, then run you code that protects the fields.

Jasmin

View solution in original post

5 Replies

Avatar

Level 10

I think you want to use generatePDFOutput from the Output service.

This will create a non-interactive version of your PDF.

Jasmin

Avatar

Level 2

Hi Jasmin,

Thanks for your answer.

It looks Output service is a separate module since I don't have it in the services tab in the Workbench.

Does it mean that I don't have it?

If so, is there a workaround?

Thanks,

Jake

Avatar

Correct answer by
Level 10

Does it mean that I don't have it?

Probably.

If so, is there a workaround?

When you submit your XML, you could set a hidden field (let's say true). Then, OnInitialize of the form, check the hidden field, and if it's true, then run you code that protects the fields.

Jasmin

Avatar

Level 2

Thanks for your idea.

It didn't work in Initialize event. It looks that the only reliable event that works is layout:ready event.

Oh, one other thing.

I want to make the submit button invisible, so I added [ButtonName].presence = "hidden" but it still shows up...

Avatar

Level 2

Figured it out.

I used "invisible" instead of "hidden" for the submit button.