Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I've been using it as well and while it has really saved us tons in development time it doesn't have or do everything we need.

Anyone interested in PDF document dispatch might also wish to check out HTMLDOC It can be called in a Perl script using system. I use a homegrown templating routine to generate an RG authorization complete with tabular layout, store it temporaily as HTML from a MySQL table, and then pass the temp file name to HTMLDOC and poof! instant PDF file ready for faxing. It's even easier than PDFLib. Here's a fragment from an actual app

our $template; &template_fun; $template =~ s/\#([^\#])\#/${$1}/ge; # see update note my $tmstamp = localtime; $tmstamp =~s/ |:|-/_/g; my $tmpfile = "D:\\pdfs\\" . $tmstamp . ".html"; open (HTMLFILE, ">$tmpfile") || die "cannot do it: $!"; print HTMLFILE "$template"; close(HTMLFILE); ## here's where we make the actual system call chdir "D:\\HTMLDOC\\"; system("htmldoc -t pdf --webpage -f D:\\pdfs\\" . $RGA_num . ".pdf $tm +pfile"); unlink $tmpfile; sub template_fun(){ $template = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <TITLE></TITLE> </HEAD> <BODY> <center>Returned Goods Authorization</center> <TABLE border=0 width=595> <TR> <TD width=85 valign=top> <P> <IMG SRC="D:\inetpub\wwwroot\images\D2.jpg" ALIGN=left><BR cle +ar=all> </TD> <TD width=450 valign=top><H2>#companyName#<BR> <font size=-2>#ourphone# #ourfax#</font></H2> </TD> </TR> <TR> <TD width=85>&nbsp;</TD> <TD width=450> <TABLE BORDER=0 width=350> <TR> <TD valign=top>To: #attn#<BR> Company: #cust_name#<BR> Phone: #phone#<BR> #dmethod#: #fax# </TD> <TD valign=top>From: #tech#<BR> Fax back: #our_fax#<BR> Reason for return: #code#<BR> Date: #date#<BR> Order number: #ord_num# </TD> </TR> </TABLE><P> <font size=+1>RGA number: #RGA_num#</font> <font size=2>(Write thi +s number on the outside of your package)</font> #raddress# </TD> </TR> </TABLE> </BODY> </HTML>'; }
# Update: just read Death to Dot Star!

In reply to Re: Re: XML2PDF by earthboundmisfit
in thread XML2PDF by holygrail

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-16 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found