Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked


by earthboundmisfit (Chaplain)
on Jul 03, 2001 at 21:44 UTC ( #93596=note: print w/replies, xml ) Need Help??

in reply to Re: XML2PDF
in thread XML2PDF

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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://93596]
[Discipulus]: LA something a little more perlish? @mts = map {qx!mp3info -p $_!} glob '/path/*.mp3 (hazarded code)
[Discipulus]: many monks want to be hired tonight, other haired and some aired
[Lady_Aleena]: Discipulus, do glob recurse?
[Lady_Aleena]: s/do/does/;
LanX wants to be fired
[Discipulus]: i fear no
[Discipulus]: i invented also 'gired'
[Lady_Aleena]: Discipulus, then that is a problem. I wanted to find total seconds of my entire .mp3 collection to do some math on it to see how many days of continuous music i have.
[LanX]: darn. .. I wanted to see Marine and Melonchon go to next round, just for fun xD

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-04-23 20:28 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.