Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to display custom unprotected content in protected PDF files?

Avatar

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
AndrewS1
Level 2

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?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
DarrenBiz
Level 5

20-08-2018

I think you are talking about adding a Cover Page to policy protected documents [1]

[1] AEM forms * Add cover page to policy protected documents

Answers (8)

Answers (8)

Avatar

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
AndrewS1
Level 2

20-08-2018

DarrenBiz​ Thank you so much! I really cannot thank you enough!

In my code, I literally replaced a call to .protectDocument() with a call to .protectDocumentWithCoverPage(), and everything worked out of the box.

Avatar

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
AndrewS1
Level 2

22-08-2018

Thanks DarrenBiz, I do not know how I missed that method! Unless it was not there yet when I developed the External Authorizer, it was 3 years ago.

Unfortunately it did not work, calling the method did not change the error message in Adobe Reader. But at least now I have something to go to Adobe support with.

Avatar

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile

Avatar
Validate 10
Level 5
DarrenBiz
Level 5

Likes

67 likes

Total Posts

205 posts

Correct Reply

37 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 1
View profile
DarrenBiz
Level 5

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)

Avatar

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
AndrewS1
Level 2

21-08-2018

DarrenBiz​ Maybe you could help me with something else please?

We use External Authorizer with AEM Forms, so as per documentation we implemented public class MyExternalAuthorizer implements ExternalAuthorizer { … }, which has a method @Override public ExternalAuthResultDTO evaluate(ExternalAuthDTO authDto) { … }. In the method, we create new instance of ExternalAuthResultDTO class and call .setPermissions() on it to apply permissions as needed if the user is allowed to view the document.

But if the user is not allowed to view the doc, we just return the instance of ExternalAuthResultDTO without setting any permissions. As a result, the user sees this in Adobe Reader:

Image3.png

Is there a way to customise this message?

Avatar

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
AndrewS1
Level 2

20-08-2018

Yes, but I think what I'm talking about is not metadata. That's what I'm trying to figure out - what is it? Have a look here: How to display custom content in protected PDF files? - Stack Overflow . I posted screenshots of such document when opened by Adobe Reader and by 3rd-party viewer.

Avatar

Avatar
Give Back 5
Employee
kjaeggin
Employee

Likes

17 likes

Total Posts

110 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Employee
kjaeggin
Employee

Likes

17 likes

Total Posts

110 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
kjaeggin
Employee

20-08-2018

I believe you can leave the document's metadata unencrypted. This is an option when protecting the document.

Avatar

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
AndrewS1
Level 2

Likes

5 likes

Total Posts

23 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
AndrewS1
Level 2

20-08-2018

Correct, none of 3rd-part viewers will show the document content. But apparently you can add some unprotected content that will be displayed by 3rd-party viewers. While Adobe Reader does not display it and instead asks you to log in to AEM Forms.

Avatar

Avatar
Give Back 5
Employee
kjaeggin
Employee

Likes

17 likes

Total Posts

110 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile

Avatar
Give Back 5
Employee
kjaeggin
Employee

Likes

17 likes

Total Posts

110 posts

Correct Reply

11 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 5
View profile
kjaeggin
Employee

20-08-2018

I am fairly certain, most 3rd party viewers do not support the security libraries required to view a policy protected document. You would need Acrobat Professional, Acrobat Reader, or Acrobat Reader mobile.There is supporting documentation here, on the architecture and clients supported at [1].

[1] Adobe Experience Manager Help | Document security offerings