Re: Tk::Canvas to PDF module offer
Petr Pajas <[email protected]>
| Newsgroups | gmane.comp.lang.perl.tk |
|---|---|
| Message-ID | <[email protected]> |
Dne út 30. listopadu 2004 13:58 jste napsal(a): > Well, I installed the PDF::API2 through the ppm (Activestate > perl) > > Now what? See the attachment of my previous post. It's not click&install! There are too files: PDF.pm and rgb.pm. PDF.pm is intended to be placed in a directory structure Tk/Canvas/PDF.pm while rgb.pm is in Tk/rgb.pm. Take these attachments and install them somewhere in your PERLLIB to the above subdirectories. In your code, you would ten use Tk; use Tk::Canvas::PDF; ... $canvas->pdf( ...arguments... ); see the POD info in PDF.pm for the arguments syntax. If in doubt, look at the code. I'm sorry, as I said, the module isn't ready for deployment, you'll have to invest some time to find out how to use it. -- Petr > giving > > >perldoc Tk::Canvas::PDF > > i receive no results (i tried to install the Tk::Canvas::PDF > using ppm but it cannot find that module) > > How to unify the Canvas and Pdf api now? > > > > ----- Original Message ----- > From: "Petr Pajas" <[email protected]> > To: "John" <[email protected]> > Cc: <[email protected]> > Sent: Tuesday, November 30, 2004 2:16 PM > Subject: Re: Tk::Canvas to PDF module offer > > Dne út 30. listopadu 2004 08:31 John napsal(a): > > Hello > > > > How did you hack the module? > > Simply:-) It uses PDF::API2 module to create the actual PDF > content. It creates a new PDF object and a PDF page, then it > examinines every object on a given canvas one by one and > translates it to a corresponding PDF-object. It's really only a > matter of itemCget, some conversions on the object parameters and > some PDF::API2 calls. > > The only harder thing to implement were the arrows (if a > multi-line is smooth, you have to position the arrow head > correctly) and shapes. > > > Does it work for you? With any encoding even with iso-8859-7 ? > > Yes, of course, it works for me fine (Linux/Windows/MacOSX-X11) > :-) (I use it as one of Print outputs in a tree-editor called > TrEd - used mostly for linguistic annotation, see > a shot: http://ckl.mff.cuni.cz/pajas/tred_doc/pics/treddiff.png > or homepage: http://ckl.mff.cuni.cz/pajas/tred/), > > Yes, I hope it should handle iso-8859-7 too (at least, it worked > with iso-8859-2 and iso-8859-6). If using "8bit" Tk (<800) only > have to specify the encoding to the PDF conversion routine. If > you use unicode/utf8 Tk>804, it should work out of the box. > > > Could you tell us more, because that is so intresting. > > It's attached. It's called Tk::Canvas::PDF and uses the same > namespace. It can be used in various ways, but as the simplest > approach it adds a new $canvas->pdf method (very similar to > $canvas->postscript) to the Tk::Canvas namespace. > > It depends on the attached Tk::rgb.pm (it's just color-names to > rgb map) and the standard Encode module (perl>=5.7), but the > later dependency should be relatively easily to remove. > > I think it gives best result with TrueType fonts, but PS fonts > and PDF-core fonts are supported as well. > > It only lacks documentation, except for a short (probably > outdated) synopsis-like POD. > > As I told earlier, I don't have time to put it all in shape, at > least not right now. So if anyone was interested in taking it, > probably going through the code, writing some POD and preparing > it for a release, I'd be glad. If not, you can use it as it is. > Maybe in the up-comming weeks I'll be able to find some to do > that myself... > > -- Petr > > > ----- Original Message ----- > > From: "Petr Pajas" <[email protected]> > > To: <[email protected]> > > Sent: Monday, November 29, 2004 8:06 PM > > Subject: Tk::Canvas to PDF module offer > > > > > > > > -++**==--++**==--++**==--++**==--++**==--++**==--++**== > > This message was posted through the Stanford campus mailing > > list server. If you wish to unsubscribe from this mailing > > list, send the message body of "unsubscribe ptk" to > > [email protected] > > -++**==--++**==--++**==--++**==--++**==--++**==--++**== > This message was posted through the Stanford campus mailing list > server. If you wish to unsubscribe from this mailing list, send > the message body of "unsubscribe ptk" to > [email protected]
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD8DBQBBrHy7QfxdLDi03+IRAkP9AJ4sK2Rk9AZ/6Dw6TQ0lNclVp1zbRQCfVt7u D1UcitLk40SlfTbphpo6yC0= =59xF -----END PGP SIGNATURE-----