Expand my Community achievements bar.

Preview Microsoft Office files like PPT, DOC, excel on web page

Avatar

Level 2

We have a requirement to preview the Microsoft Office files(ppt, doc, excel files stored in AEM DAM) on a web page.

1. Preview should be a pop-up when clicked on a preview button. It should display the desired format file on popup.

 

2. The other part of this requirement is to provide an option on the pop-up itself to search for a keyword within the previewed file.

The searched result should contain the slides/page number with the number of times that keyword(highlighted in any color when the slide/page containing the keyword is opened) appeared on the slide/page. 

Pop-up on the left side can have a search box, and below to search box can show the search results. While on the right side, it previews the file.

 

Could you please share the best practice for implementing such functionality or suggest a feasible approach or any built-in library available?

 

Note: since the MS files are located in AEM DAM, Google Doc Viewer/ MS Office Online would not be a fit solution.

7 Replies

Avatar

Community Advisor

Hi, 

 

I don't think there is anything ootb in AEM to render such documents, however, you can rely on Google Docs viewers, please check this example: https://jsfiddle.net/7xr419yb/.

https://stackoverflow.com/questions/9418850/how-to-display-a-word-document-using-fancybox 



Esteban Bustamante

Avatar

Level 2

Hi, thanks for your reply.

Since the MS files are located in AEM DAM, Google Doc Viewer would not be a fit solution.

Avatar

Level 4

Hi @AshishPa 

 

To create a preview option, you have to create a custom modal window component that display the asset.. In the same component you can add the search functionality.

For search functionality inside assets please refer https://www.argildx.us/technology/fulltext-search-in-aem-pages-assets-custom-search-pdf-excel-and-po...

 

Thanks

 

Avatar

Level 2

Hi @Gaurav_Sachdeva_ , thanks for your reply.

Could you please confirm if this search is only specific to the single file?

The expectation is that the search is done within a file, not in its sibling files under the same parent folder. 

Avatar

Level 4

Hi @AshishPa I believe if you give exact path to the specific asset such as pdf and do full text search than you get results from that asset only.

Avatar

Administrator

@AshishPa Did you find the suggestions from users helpful? Please let us know if more information is required. Otherwise, please mark the answer as correct for posterity. If you have found out solution yourself, please share it with the community.



Kautuk Sahni

Avatar

Level 2

I am still expecting some good suggestions for point 1 in above problem statement.