Expand my Community achievements bar.

PDF Viewer Not Displaying on Published Website

Avatar

Level 2

I am trying to use the PDF Viewer for the first time on one of our sites.  I've followed the steps from https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/pdf-view....  I also configured the sling:configs nodes under /conf on author and publish using the appropriate clientId  with the one on publish being the one for the domain of the published site.

 

Everything seems to work fine on author and I'm able to successfully embed a PDF on the page.  However on the published site, the PDF doesn't display at all.  Viewing the page source shows that there is only an empty div there of class "pdfviewer section".  If I view the page directly on the publish server, it displays the pdf viewer.  This makes me feel like I've replicated everything to publish correctly. I do get the "File preview not available" message because the domain of our publish server is different that the domain of the published site.  If I view the page source on publisher and copy the generated code from the pdfviewer div into the source on the published site using the Inspector, the PDF displays fine.

 

This makes me believe that there is a dispatcher setting or something like that that is causing the PDF to not show up on the published page.  I don't see any errors in the log files on publisher.  I'm sure it's some little something that I'm missing, but I just can't seem to figure out this missing piece.  Does anyone know what setting (or settings) I need to check or anything else I can try to figure out why it's not working on the published site.  Any help would be appreciated.

 

We are on AEM 6.5 and using IIS.

 

Thanks!

5 Replies

Avatar

Community Advisor

@robertt3523754 

Here I could see two scenarios -

1. you have pdf in div but not visible.

2. pdfviewer div is not present.

Since you are facing {2} issue, can you please check your configuration by matching this properties and markup.

https://www.aemcomponents.dev/content/core-components-examples/library/page-authoring/pdf-viewer.htm...

if {1}, then you will have to check if your pdf is published or not, if yes, then dispatchcer is restricting pdf extension.

# This rule allows content to be access
/0010 { /type "allow" /extension '(css|eot|gif|ico|jpeg|jpg|js|gif|pdf|png|svg|swf|ttf|woff|woff2|html)' /path "/content/*" } # disable this rule to allow mapped content only

Avatar

Level 2

I checked and the allow for the pdf extension is set in dispatcher.any.  Also I can view the PDF directly on the published website using the full path.  It's just not getting embedded to the page. 

 

To clarify, the div appears on the page on the published site, it's just an empty div.

<div class="pdfviewer section">

</div>

What I see on the page if I view it in publisher is

<div class="pdfviewer section">
     <div class="cmp-pdfviewer" id="pdfviewer-a0b3e051af" data-cmp-is="pdfviewer" data-cmp-client-id="65c0558856c94a8ca15498e1ed5aad62" data-cmp-document-path="/content/dam/extension-county-offices/Setup your Account.pdf" data-cmp-document-file-name="Setup your Account.pdf" data-cmp-viewer-config-json="{&#34;embedMode&#34;:&#34;FULL_WINDOW&#34;,&#34;defaultViewMode&#34;:&#34;FIT_PAGE&#34;,&#34;showAnn...">
     <div id="pdfviewer-a0b3e051af-content" class="cmp-pdfviewer__content cmp-pdfviewer__full-window"></div>
</div>

 

Avatar

Level 10

Hi @robertt3523754,

It should be an issue with ClientId. 

Cross check if you are having and using a dedicated clientId for the actual domain. (The client Id that is working in publish instance is for publish application server)

Similar issue addressed here in this thread - https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/issues-with-pdf-viewer/qaq...

 

Avatar

Level 1

Hi @Vijayalakshmi_S ,
Could you please assist what to check if the div is showing up but not pdf.Domain is localhost