Saturday, 15 May 2010

Converting xlsx, docx, pdf files as jpg images using PHP -


Is there any way to convert xlx, docx and pdf files into image (jpg) format using php? I need to read this file from a server and convert them to images and show them on the page.

Thanks in adv

If you want to achieve it, then you first Your XLSX or DockX has to be converted to PDF

The best way to do this is to install LibreOffice on your server.

Then use the headless command of libreoffice to convert to PDF

  shell_exec ('libreoffice --headless -convert- to pdf file toconvert.docx -outdir output / Path / for / pdf ');  

Then convert your PDF to jpg

  shell_exec ('/ usr / local / bin / myfile.pdf myfile.jpg');  

No comments:

Post a Comment