Just to make sure I need to use only Perl no other stuff
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');
|