Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Hello Monks,

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.

I am getting this error:

Tk::Error: Can't write to '\CompletedOrder.gif-3128': Permission denie +d at C:/Perl/lib/LWP/Protocol.pm line 105. at C:/Perl/lib/LWP/UserAge +nt.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.p +m 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 14 +1 PDF::FromHTML::convert at C:/Perl/site/lib/PDF/FromHTML.pm line 172 main::ViewSingleOrder at C:\BLABAD~1\/ViewOrder.pl line 244


I am using the following code (Taken from CPans Docs):
my $pdf = PDF::FromHTML->new( encoding => 'utf-8' ); # Loading from a file: # $pdf->load_file('source.html'); # Or from a scalar reference: $pdf->load_file(\$page_html); # Perform the actual conversion: $pdf->convert( # With PDF::API2, font names such as 'traditional' also works Font => 'font.ttf', LineHeight => 10, Landscape => 1, ); # Write to a file: $pdf->write_file('target.pdf');


Thank you
Bob

In reply to PDFtoHTML Mod by randor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others scrutinizing the Monastery: (8)
    As of 2014-09-19 17:09 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (143 votes), past polls