daemonchild has asked for the wisdom of the Perl Monks concerning the following question:

hello all ...

any help with this would be much appreciated

what i've been asked to build is a web based system where people can upload their resume's in MS Word documents through a web form, and have the Word docs converted to PDF and posted on the net ...

a quick CPAN search yielded Win32:OLE, PDF::Create, and CGI::Test::Form::Widget::Input::File as possible modules to help me out with this ...

anybody have any insight as to if what i've been asked to do is possible? if it is, are there better modules than what are named above?

many thanks

-- steve

Replies are listed 'Best First'.
Re: cgi, forms, MS Word, and PDF ... yowza
by ryddler (Monk) on Jun 09, 2001 at 03:58 UTC

    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();


    ryddler
Re: cgi, forms, MS Word, and PDF ... yowza
by Jouke (Curate) on Jun 10, 2001 at 22:07 UTC
    I'd recommend looking at PDFever. Though not free (although I believe an old version is available for free), this looks like a very promising product for creating PDF from Perlscripts.

    Jouke Visser, Perl 'Adept'
    Using Perl to help the disabled: pVoice and pStory