Skip to main content
Participant
May 17, 2023
Question

Preview all file type with PDF Embed API

  • May 17, 2023
  • 2 replies
  • 2167 views

Hi all, firstly please correct me if  I open this post at incorrect location.

 

I have some document and media files stored in AWS S3 bucket. My website is using PHP 7.0 and Jquery
Because Google Doc Viewer limits the max file size to preview at 25MB. So I replace it with PDF Embed API.


This API is only for previewing PDF while I need to preview any file types such as ( doc, docx, csv, xls, xlsx, pdf, png, jpg, jpeg ).


I tried to research and had some ideas that I need to convert all other file types to PDF first, and Adobe Service API can do that ( create a PDF file from other file )


The problem is I feel it's too hard to apply this.
The follow will be: get file from S3 via a public URL -> check file type -> if file type is not PDF -> convert it -> preview that file ( using Embed PDF API )

 

Please help me to have a simple view for that above follow ( eg: what API I should use ,.... )


I would appreciate any ideas. Thank you

 

This topic has been closed for replies.

2 replies

Raymond Camden
Community Manager
Community Manager
May 18, 2023

As stated, you could convert your other items to PDFs, but the Embed viewer won't be updated to support non-PDF items. 

Participant
May 18, 2023

Hi Raymond, Thanks for your response. I agree with your idea. But I would like to convert files automatically by using API or something like that.

Raymond Camden
Community Manager
Community Manager
May 18, 2023

So yes, we have an API that lets you convert from Office, HTML, and some image formats. Embed viewer wouldn't do that for you - you would need to write code that looks at your directory of assets, converts them, and is run on some sort of schedule so it handles new images being added there. 

 

All in all, completely doable, just not something I can share in a forum post. Also note our APIs are not free like Embed (although we have a free tier coming).

Legend
May 17, 2023

Why not pre-convert things as you add them to the bucket (or in a batch) and present for preview only the PDFs? Live conversion to PDF could easily take so long that the user will wander off to another web site, as well as potentially having a substantial and uncontrollable cost.

Participant
May 18, 2023

Hi, thanks for your response.
Firstly, I want to keep the original file type so that user can download it instead of storing 2 file types or just pdf type.
I can see some services can convert it quickly (they convert my file to PDF or PNG file to preview). We can let user know the file is preparing to preview by showing a notification, user can wait in 1 or 2 minutes, but if the conversion proccess takes too long as you mentioned, then I need to find other solutions or services.
Anyway, the purpose of my question is create something like Google Docs View but can preview a file more than 25MB. I just need to preview