LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   htmldoc problem (https://www.linuxquestions.org/questions/linux-newbie-8/htmldoc-problem-678069/)

vamsi_k 10-21-2008 10:39 AM

htmldoc problem
 
OS: centos 5.2

installed htmldoc-1.8.27-5.0.el5 , HTML-HTMLDoc-0.10

i created a sample.html and wrote :

<table border=22>
<tr>
<td>1</td><td>2</td><td>3</td>
</tr>

<tr>
<td>1</td><td>2</td><td>3</td>
</tr>

<tr>
<td>1</td><td>2</td><td>3</td>
</tr>

<tr>
<td>1</td><td>2</td><td>3</td>
</tr>

</table>


*******

created html_2_pdf.pl

and wrote

#!/usr/bin/perl -w
use HTML::HTMLDoc;

my $htmldoc = new HTML::HTMLDoc();
$htmldoc->disable_encryption();
my $strplan=$ARGV[0];
my $filename=$ARGV[1];
$htmldoc->set_permissions('all');
$htmldoc->set_output_format('pdf');

$htmldoc->set_input_file('/path/of/file'.$strplan.'.html');
$htmldoc->set_footer('.','.','.');
my $pdf = $htmldoc->generate_pdf();

$pdf->to_file('/path/of/file/'.$filename.'.pdf');

***

and as a non root user when i run

perl html_2_pdf.pl sample.html test.pdf

file is creating but no data is written in that file

same when i run as a root user the its working fine.

i gave most of the files and folders 777 permissions.


what more permissions should be given to non root user to run the

command perl html_2_pdf.pl sample.html test.pdf
sucessufully.

i installed perl packages :

perl-Digest-SHA1-2.11-1.2.1
perl-Digest-HMAC-1.01-15
perl-HTML-Tagset-3.10-2.1.1
perl-Net-SSLeay-1.30-4.fc6
perl-5.8.8-10
perl-Socket6-0.19-3.fc6
perl-Compress-Zlib-1.42-1.fc6
perl-Archive-Tar-1.30-1.fc6
perl-Net-IP-1.25-2.fc6
perl-libwww-perl-5.805-1.1.1
perl-IO-Zlib-1.04-4.2.1
perl-String-CRC32-1.4-2.fc6
perl-HTML-Parser-3.55-1.fc6
perl-DBI-1.52-1.fc6
perl-IO-Socket-INET6-2.51-2.fc6
perl-DBD-MySQL-3.0007-1.fc6
perl-URI-1.35-3
perl-Net-DNS-0.59-3.el5
perl-IO-Socket-SSL-1.01-1.fc6

any ideas ?

vamsi_k 11-27-2008 06:21 AM

when i tried with php code it worked fine and the problem is solved.

htmldoc can be used with java , perl and php


All times are GMT -5. The time now is 03:44 PM.