#!/usr/bin/perl use strict; use warnings; use Text::FromAny; my $file = '/root/Desktop/test.doc'; my $tfile = '/root/Desktop/text.txt'; open STDOUT, '>', $tfile; my $tFromAny = Text::FromAny->new(file => $file); my $text = $tFromAny->text; print $text, "\n"; system("a2pdf -o /root/Desktop/text_is_pdf.pdf $tfile"); close STDOUT;