<?xml version="1.0" encoding="windows-1252"?>
<node id="995794" title="PDFtoHTML Mod" created="2012-09-26 11:25:07" updated="2012-09-26 11:25:07">
<type id="115">
perlquestion</type>
<author id="994918">
randor</author>
<data>
<field name="doctext">
Hello Monks,
 &lt;br&gt;&lt;br&gt;
Im back. Well, working with TK and I am trying to figure out a solution to  be able to print a page. I tried WIN32::Printer but to no avail, I kept getting error -3 "Unable to connect to printer" I tried every possible solution (I think it might have to do with the fact that all printers are on a network and none are local to me) but anyway, I have since moved onto trying to build an HTML page and convert it to PDF, then linking to it from the program so they can print it.
 &lt;br&gt;&lt;br&gt;
I am getting this error:
 &lt;br&gt;&lt;br&gt;
&lt;code&gt;Tk::Error: Can't write to '\CompletedOrder.gif-3128': Permission denied at C:/Perl/lib/LWP/Protocol.pm line 105. at C:/Perl/lib/LWP/UserAgent.pm line 891.
 at C:/Perl/site/lib/PDF/FromHTML.pm line 141.
 LWP::UserAgent::mirror at C:/Perl/lib/LWP/UserAgent.pm line 891
 LWP::Simple::mirror at C:/Perl/lib/LWP/Simple.pm line 91
 PDF::FromHTML::Twig::__ANON__ at C:/Perl/site/lib/PDF/FromHTML/Twig.pm line 192
 XML::Twig::_twig_end at C:/Perl/site/lib/XML/Twig.pm line 2295
 XML::Parser::Expat::parse at C:/Perl/lib/XML/Parser/Expat.pm line 474
 XML::Parser::parse at C:/Perl/lib/XML/Parser.pm line 192
 Carp::croak at C:/Perl/site/lib/Carp.pm line 100
 XML::Twig::_croak at C:/Perl/site/lib/XML/Twig.pm line 2821
 XML::Twig::_checked_parse_result at C:/Perl/site/lib/XML/Twig.pm line 766
 XML::Twig::parse at C:/Perl/site/lib/XML/Twig.pm line 747
 PDF::FromHTML::parse_file at C:/Perl/site/lib/PDF/FromHTML.pm line 141
 PDF::FromHTML::convert at C:/Perl/site/lib/PDF/FromHTML.pm line 172
 main::ViewSingleOrder at C:\BLABAD~1\/ViewOrder.pl line 244&lt;/code&gt;
 &lt;br&gt;&lt;br&gt;
I am using the following code (Taken from CPans Docs): &lt;br&gt;
&lt;code&gt;            my $pdf = PDF::FromHTML-&gt;new( encoding =&gt; 'utf-8' );

    # Loading from a file:
    # $pdf-&gt;load_file('source.html');

    # Or from a scalar reference:
     $pdf-&gt;load_file(\$page_html);

    # Perform the actual conversion:
    $pdf-&gt;convert(
        # With PDF::API2, font names such as 'traditional' also works
        Font        =&gt; 'font.ttf',
        LineHeight  =&gt; 10,
        Landscape   =&gt; 1,
    );

    # Write to a file:
    $pdf-&gt;write_file('target.pdf');&lt;/code&gt;
 &lt;br&gt;&lt;br&gt;
Thank you&lt;br&gt;
Bob</field>
</data>
</node>
