How to convert Excel files into PDF

It's simple to do using Open Office software – it have this operation in the main menu File.

And how about to use it on the webserver? – Very simple.

Requirements:

  • Linux VPS with about 512Mb RAM
  • HDD from 4Gb
  • OS CentOS 5.2

ToDo:

  1. Install XWindows – 'yum groupinstall “X Window System”'
  2. Install VNC-Server
  3. Run VNC-Server (geometry 800×600)
  4. Connect to it from your home computer using VNC-client
  5. Install Firefox – 'yum install firefox'
  6. Using Firefox – take & install latest OpenOffice
  7. Open Calc – and change its settings into 'Print all sheets'
  8. Install ghostscript – 'yum install gs'
  9. Make the new virtual printer using VNC – 'PDFconverter'
  10. Take & install 'pdftk' – probably it'll help you to modify PDFs

Well. Now you can upload & create a XLS file, then convert it into PDF using command:
soffice -norestore -nofirststartwizard -nologo -headless -pt \”PDFconverter\” $fname &

What's it mean?

  • 'soffice' – is the OpenOffice software
  • 'norestore' – it'll not ask user about to restore any documents before open the editor
  • 'nofirststartwizard' – no 'Master' window on starting
  • 'nologo' – no logotype
  • 'headless' – not show any window for user (our user is robot)
  • 'pt' – print the file $fname onto the printer 'PDFconverter'
  • '&' – run the program in the background mode

That's all for now.

articles_2010/xls2pdf.txt · Last modified: 2011/09/30 11:21 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki