How to display custom unprotected content in protected PDF files?

AndrewS1

14-08-2018

When a PDF document is protected with a security policy from LiveCycle ES or AEM Forms, it can only be opened by Adobe Reader. Here's what it looks like when you try to open it in another PDF viewer.

Microsoft Edge:

zL7Eq.png

Firefox (internally uses PDF.js):

orI7T.png

But I have seen secured PDF documents that in other viewers show customised content - e.g. instructions to download and install Adobe Reader. So there must be a way to add unprotected content to protected PDF files, which other PDF viewers will display. How can I do it?

View Entire Topic

DarrenBiz

22-08-2018

I haven't actually used the functionality that you are describing, but I took a quick look at the ExternalAuthResultDTO API and it has a method public void setAccessDeniedErrorMessage(java.lang.String accessDeniedErrorMessage) [1] . This looks like it should customise the error message that is returned if the user doesn't get any permissions set.

The method says it sets the error message during the evaluate() method so if you override this method (as you are) I expect you can set your own message to be returned.

[1] ExternalAuthResultDTO (AEM forms on JEE Java API Reference)