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

Issues with PDF Viewer

Avatar

Level 4

Hello All - We have extended the PDF viewer core component into our app : /apps/app-name/ by following the below medium article and also created the "Content Aware configuration" under /conf/app-name/ and added the property "sling:configRef" that points to Context Aware Config path under /content/site/.

 

https://medium.com/adobetech/pdfs-in-aem-embed-pdfs-into-your-pages-with-pdf-viewer-7115c60b3c34

 

After we made all the requirement changes and specify the PDF path in the dialog, the component is not rendering the PDF. The component is not editable and we are able to open the dialog only from Side Panel -> Content Tree. Please see the attached screenshot. Can someone tell me what could be the issue?

 

aemninja_0-1618974019534.png

 

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @aemninja,

One of the possible cause would be the clientId used in sling:configs. Can you confirm if it is the valid one generated for your application. 

If yes, you can cross check directly by placing the markup(code snippet available in below link) in any component or in base page component. (by hardcoding the clientId and specific document instead of via PDF viewer component. Based on this result, we can narrow down the issue)

More details related to this in this documentation - https://medium.com/adobetech/easily-embed-pdf-into-your-website-using-adobe-document-cloud-view-sdk-...

 

View solution in original post

22 Replies

Avatar

Community Advisor

@aemninja,

If configMap is null, then the issue is with the way we reference the OSGI Factory Service. 

In general, to refer OSGI service in Sling Model, we use either @Inject or @OSGiService annotation. As we have to get all instance of factory config via multiple and dynamic referencing, I suggest to create another service/impl to create this configMap object and expose that (In other words, move the Reference logic to another OSGI component) -> Use that service that returns the map in Sling Model via @Inject or @OSGiService annotation. 

 

Avatar

Level 2

Hi @Vijayalakshmi_S I followed the replies and I appreciate all your help with the PDV Viewer component. But I didn't understand how I can configure my environments to work. 

Could you please help me?

 

I have my PDF Viewer as a proxy component on my local. I used the Override CA Config to have my clientId number working on my localhost. But how I can have the configs to the other clientIds related to my other domains? For example, I need a different clientId for my dev author environment, because it has a different domain. 

I tried the CA Configuration Override solution. It works on my local, but how I can specify the dev author? I tried to add more lines on the Override with .dev.author, but seems that these lines are no readable by my author-dev instance. 


Captura de Tela 2023-02-06 às 15.32.10.png