Re: PDF Javascript
Ben <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.pdfapi2 |
|---|---|
| Message-ID | <7927612.1186666924317.JavaMail.root@elwamui-rubis.atl.sa.earthlink.net> |
The only thing I can think of is using PDF form of sometype, I have never used it, but could be possible to get somekind of input or something, Since PDF is a application and opened using Adobe reader I do not think you can use a client side script (I have been wrong before). what I would do if you need something more dynamic I would use a variable from the page serving the PDF and pass a variable or something and use API2 to print it to the pdf, its the only thing I can think of off the top of my head, Although I will look it up and see if I can fine something more like your looking for. -----Original Message----- From: Todd Hamilton Sent: Aug 9, 2007 9:04 AM To: [email protected] Subject: Re: [perl-text-pdf-modules] PDF Javascript Ben, Thanks for that input. I will most likely do something like that. It really does make sense to do it that way. My goal though was to get an updated date value without having to manipulate the pdf. My thought is that if I have to update the pdf using pdf::api2, then I (think) would have to have use a server side printing method. (Which may be the way I have to go anyway) I would rather do client side printing. My pdfs are being served to the client in a web page. I would like the users to just click print from within the acrobat plugin. What do you think? --- Ben <[email protected] > wrote: --------------------------------- forgive me if I am not understanding what exactly you want, but if all you need is a date inside the pdf why not do something like this use PDF::API2; use strict; my $pdf = PDF::API2->new; my $page = $pdf->page; my $fontType = qq(Helvetica); my %font = ( Helvetica => { Bold => $pdf->corefont('Helvetica-Bold', -encoding => 'latin1'), Roman => $pdf->corefont('Helvetica', -encoding => 'latin1'), Italic => $pdf->corefont('Helvetica-Oblique', -encoding => 'latin1'), }, ); my $datestring = tdate(); newText($fontType, 'Bold', 14/pt, 'black', 7/mm, 270/mm, $datestring ); sub newText{ my $flashVars = $page->text; $flashVars->font( $font{$_[0]}{$_[1]}, $_[2] ); $flashVars->fillcolor( $_[3] ); $flashVars->translate( $_[4], $_[5] ); $flashVars->text( $_[6] ); } sub tdate { @_ = localtime(shift || time); return(sprintf("%02d:%02d %02d/%02d/%04d", @_[2,1], $_[4]+1, $_[3], $_[5]+1900)); } -----Original Message----- From: "Mr. Shawn H. Corey" Sent: Aug 7, 2007 6:53 PM To: [email protected] Subject: Re: [perl-text-pdf-modules] PDF Javascript netarttodd wrote: > I would like to use PDF::API2 to create a pdf that includes > javascript. What I am trying to actually accomplish is have an > updated print date appear at the bottom of the pdf and updated each > time the document is printed. I think it can be done via javascript, > but I don't know how to add the javascript code to the pdf using > PDF::API2. Thanks for you help. I don't remember Javascript being mentioned inside PDF. But you can look yourself at http://www.adobe.com/devnet/pdf/pdf_reference.html -- Just my 0.00000002 million dollars worth, Shawn "For the things we have to learn before we can do them, we learn by doing them." Aristotle __________________________________________________________ Choose the right car based on your needs. Check out Yahoo! Autos new Car Finder tool. http://autos.yahoo.com/carfinder/ __._,_.___ Messages in this topic (0) Reply (via web post) | Start a new topic Messages | Polls | Members To unsubscribe from this group, send an email to: perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@public.gmane.org http://groups.yahoo.com/;_ylc=X3oDMTJkMDM1am1oBF9TAzk3NDc2NTkwBGdycElkAzIwMTczODIEZ3Jwc3BJZAMxNzA1MDA3NzA5BHNlYwNmdHIEc2xrA2dmcARzdGltZQMxMTg2NjY3MTg5 Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch format to Traditional Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe Recent Activity - 1 New Members Visit Your Group SPONSORED LINKS - Convert pdf - Create pdf - Pdf to dxf - Pdf server - Pdf creator Y! Messenger All together now Host a free online conference on IM. Yahoo! Mail You're invited! Try the all-new Yahoo! Mail Beta Yahoo! Groups Your one stop for beauty & fashion tips and advice. . __,_._,___