in reply to Converting .doc files to .pdf using perl
I reversed your thought process---instead of .doc to .pdf, think .pdf "from" .doc. This was my first stab at it:
#!/usr/bin/perl use strict; use Text::FromAny; use HTML::FromText; use PDF::FromHTML; my $tFromAny = Text::FromAny->new( file => '/root/Desktop/basic.doc'); my $text = $tFromAny->text; text2html($text); my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); $pdf->load_file(\$text); $pdf->convert( FontUnicode => 'Helvetica', LineHeight => 10, Landscape => 1, ); $pdf->write_file('/root/Desktop/target.pdf');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Converting .doc files to .pdf using perl
by anonymized user 468275 (Curate) on May 13, 2011 at 12:32 UTC |