in reply to cgi, forms, MS Word, and PDF ... yowza
First off, if you are talking about a public webserver where people will upload Word documents, I can't stress enough that you take extreme precautions concerning documents that may potentially contain a macro virus.
That said, you may want to look at Win2PDF which allows you to print PDF's from virtually anything that will print. Depending on the load you expect, you may choose other avenues, but I've been messing around with this one for a few days, and it does what I need.
With an Excel file, a PDF can be created with this small snippet (minor changes will adapt it for Word):
#!/usr/bin/perl -w use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; my $ExcelFile = 'C:\path\to\an\excel.xls'; my $PDF_out = 'output.pdf'; my $Printer = 'Win2PDF'; my $Excel = Win32::OLE->new('Excel.Application', 'Quit') or die Win32::OLE->LastError; $Excel->{Visible} = 1; my $Book = $Excel->Workbooks->Open( # Filename,[UpdateLinks],[ReadOnly],[Format],[Password],[WriteResP +assword], # [IgnoreReadOnlyRecommended],[Origin],[Delimiter],[Editable],[Not +ify],[Converter],[AddToMru] $ExcelFile,undef,undef,undef,undef,undef, undef,undef,undef,undef,0,undef,0); $Book->PrintOut( #[From],[To],[Copies],[Preview],[ActivePrinter],[PrintToFile],[Col +late],[PrToFileName] undef,undef,undef,undef,$Printer,undef,undef,$PDF_out); $Book->Close(0); $Excel->Quit();
|
---|