Version 13 of Trampoline!

Updated 2006-10-26 14:46:09

Mac Cody's nearly pure-Tcl PDF-savvy extension, whose home is on SourceForge at http://trampoline.sourceforge.net

Trampoline is an extension to enable Adobe PDF output from the canvas. From SourceForge:-

Trampoline! is a nearly pure-Tcl library extension that generates an Adobe Portable Document Format (PDF) document based upon the content of a Tk canvas. The intent of this extension is to provide a "modern" replacement for the Tk canvas widget command postscript, which generates a Postscript document based upon the content of a Tk canvas. Trampoline! is striving to be compliant with Adobe PDF Reference version 1.4.

DPE 10 May 2005 Thanks for a useful package. I found a bug with text that contains nothing but whitespace that causes generate to fail. This can be fixed by adding the following lines near the top of TextConvert:

      # Do not process blank text
      if {[string trim [$w itemcget $item -text]] == ""} {
          return ""
      }

RS: Trampoline is also a coding concept to allow unbounded recursion.


MP 13 August 2005 Great package.

I also found a bug, only the visible part of the canvas is placed in the pdf. This can be overcome when replacing

      AppendPageObject [winfo width $w] [winfo height $w]

by

      set Size [$w cget -scrollregion]
      AppendPageObject [lindex $Size 2] [lindex $Size 3]

In the generate proc. I have not tested it when scrollregion is not set in the canvas definition


Alastair Davies uses this on the MacOS X platform, for which it needs one modification. The output file must be fconfigured with -translation binary instead of -translation lf (16 Aug 2006)


Category Package