PDF Viewer don?t show docs for anonymous
Asked by Michael Rindler:

Hello.

Since the last upgrade, the pdf-viewer only show pdf doc?s when a user is logged in.

Anonymous user only see a emty pdf-viewer.

It seems like an authorization problem.

Greats

Michael Rindler


Answers:
author: Optimizory Technologies
body: We are also facing similar issue with Confluence 6.15.3, with Office Powerpoint.

Anonymous user can download files from download section as all permissions are provided, but cannot view inside page.

There is no issue for logged in user.

Also JS console when I checked shows, "Error: No cp/component/companion/embedded-edit-with"

![Screenshot 2019-05-01 at 3.20.52 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/53187iB3E2E9DF4BC671B5/image-size/large?v=v2&px=999 "Screenshot 2019-05-01 at 3.20.52 PM.png")

This error was not visible for logged in user.

comments: author: Shannon S
body: Hi there,

Thank you for providing this information! I was able to discover that a bug was logged for this the other day using the details you provided:

* [CONFSERVER-58207](https://jira.atlassian.com/browse/CONFSERVER-58207) *View File macro loading indefinitely for anonymous user.*

There's a workaround as follows:  

> Replace the view file PDF macro with the newer file previewer:  
> :warning: **Backup** your Confluence database before making any changes.

*
  > [How to replace old View File macros with the new File Preview macro](https://confluence.atlassian.com/confkb/how-to-replace-old-view-file-macros-with-the-new-file-preview-macro-720419365.html "Follow link")![](https://jira.atlassian.com/images/icons/emoticons/information.png) This will replace all of the view file macro in all of Confluence BLOGPOST, PAGE, and COMMENT.

I hope that helps! Thank you again for providing me those details.

Take care, and have a pleasant week.

Regards,

Shannon  


author: Shannon S
body: Hello Michael,

Thank you for reaching out!

1. Can you confirm, this is the built-in PDF viewer in Confluence?
2. What version of Confluence are you running?
3. Are the PDFs attached to spaces which are completely open to anonymous users?
4. Can you replicate this with any PDF documents?
5. When you say it's empty - is this a blank screen?

Looking forward to hearing from you soon!

Regards,

Shannon

comments: author: Michael Rindler
body: Hello Shannon.

Thx for your fast response.

Following are the answers to your questions.

1. We use the Office Connector plugin viewpdf (1258). IS this a different Confluence viewer?

2. 6.15.2

3. No

4. Yes

5. Only the frame is visible. Not the content. This change on login.

Greats Michael


author: Shannon S
body: Michael,

Thank you for the information. Yes, that's the Confluence Office Connector PDF viewer. Thank you for the confirmation.

If the PDF isn't attached to a space open to anonymous users, then it would make sense that it doesn't load for the anonymous user.

Can you explain more about how your permissions are set up? What are your global permissions like, and how is the individual page's permission set, as well as the space that it's in? Where are you embedding the PDF from if it's not from a page with anonymous access?

Regards,

Shannon


author: Michael Rindler
body: Hello Shannon.

Our global Permission :

Anonymous access = Confluence use

Area Permission:

Anonymous access = Show all

Restricted pages = none

Attachments are attached directly to the corresponding pages and integrated with Macro PDF in the page.

Greats Michael


author: Michael Rindler
body: {viewfile: name=EBook.pdf}

anonymous

![anonymous.png](https://community.atlassian.com/t5/image/serverpage/image-id/53072iB9241E80688D324D/image-dimensions/322x263?v=v2 "anonymous.png")

login user

![user.png](https://community.atlassian.com/t5/image/serverpage/image-id/53073iA55BB66AF9E55A8B/image-dimensions/312x268?v=v2 "user.png")


author: Shannon S
body: Michael,

Thank you for following up!

Can you confirm when you say *area permission* you are referring to the space permissions?

Earlier you answered in question that the attachments themselves aren't open to anonymous users, but your reply now states otherwise. Could you please confirm?

I suspect there might be confusion about what I meant by that question. I was asking specifically if you have given the users permissions in the Space permissions directly to any attachments on the page, but not whether or not they were currently working for those anonymous users.

Lastly, can you confirm if you attach any other files to the page does the same issue occur? Such as .jpg, .gif, mov, .docx, etc.

Regards,

Shannon


author: Shannon S
body: Hi Michael,

Please disregard my last response!

Using the information that the other poster has included, I was able to determine the bug for this issue is as follows:

* [CONFSERVER-58207](https://jira.atlassian.com/browse/CONFSERVER-58207) *View File macro loading indefinitely for anonymous user.*

You can check out that bug for a workaround in the meantime. Please be sure to click **This affects my team** on the bug, as it helps us keep track of the number of affected users.

Regards,

Shannon


author: Michael Rindler
body: Hello Shannon.

Your last post helped with this.

Is it also possible to disable the old macro "viewpdf"?

So that the users can not use it anymore?

Greats Michael


author: Shannon S
body: Michael,

Thank you for confirming!

it's certainly possible to disable the legacy PDF macro. However, you want to make sure you've first completed the workaround from the ticket:

* [How to Replace Old View File Macros with the New File Preview Macro](https://confluence.atlassian.com/confkb/how-to-replace-old-view-file-macros-with-the-new-file-preview-macro-720419365.html)

If you don't complete this first, then you will end up with issues on your Confluence pages.

Once you've replaced the old view file macros with the new one, you can disable the old version. Please review [Disabling and enabling apps](https://confluence.atlassian.com/upm/disabling-and-enabling-apps-273875716.html) for details on that.

The add-on you are looking for is called **Office Connector Plugin** and you'll be able to find it under **System add-ons** . Please be sure *not*to disable the entire add-on. You want to expand the listing, and then click the link on the right that says "## of ## modules enabled."

Look for the modules that are called view\*-legacy. You can disable those, but only if you have already gone through the workaround.

One more thing, but it shouldn't actually be required for you to disable the modules. We've left them as some pages are still referencing the old modules in many Confluence instances. It's no longer possible to call them when inserting a module into a page post Confluence 5.7.

I hope that helps! But let me know if you have any questions or trouble.

Regards,

Shannon


Tags: confluence-server

server