Word to PDF converter in C5?

Permalink
I had a request from a client and thought it would be nice if C5 had, or an add-on was created, that when you upload word docs to the file manager it would convert them to PDF.

What ya think?

senshidigital
 
jbx replied on at Permalink Reply
jbx
Very neat idea - and as it happens - quite do-able. There is a Zend Service called LiveDocx. I managed to do a quuick implementation in approx 5 mins and have successfully converrted one docx file to a pdf. It also includes the ability to mailmerge, so that opens up a massive possibility. I'm going to see if I can package this up, because I reckon it would be a great tool for the intranet I'm building.

Thanks for the idea!
If anyone wants a headstart on how to do this btw... You first need to signup for a free account here:https://www.livedocx.com/user/account_registration.aspx...

Then, try just chucking this in a single page and loading it (ensure you create a templates folder in your files folder and upload a word doc to it)

<?php
Loader::library('3rdparty/Zend/Service/LiveDocx/MailMerge');
$phpLiveDocx = new Zend_Service_LiveDocx_MailMerge();
$phpLiveDocx->setUsername('username')
            ->setPassword('password');
$phpLiveDocx->setLocalTemplate($_SERVER['DOCUMENT_ROOT'] . '/files/templates/My Word Doc.docx');
$phpLiveDocx->createDocument();
$document = $phpLiveDocx->retrieveDocument('pdf');
file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/files/incoming/My PDF Doc.pdf', $document);


Ruff n Ready, but works!!

Jon
senshidigital replied on at Permalink Reply
senshidigital
Nice one!

Be good to see it as an add-on so users do not need to place code on a page... but state they need an account.

Would be a good addition. ;-D