or Cancel
 

USER GUIDE

 

What you need to run this package

How to install

How to use



What you need to run this package?

* Tcl >= 8.4 (it uses dictionaries)

* Tk

* nothing more, tktopdf is pure tcl package.

 

How to install

Tktopdf is very simple package, you can install it in sevreal ways.

1) By including source file

You can simply include source files by adding these lines to your source file:

source pdf.tcl
source transformations.tcl
source tktocanvas.tcl
source tktopdf.tcl

2) By setting up auto_path variable

If you have your application and tktopdf in the same directory, you only need put these lines into your application:

set dir [pwd]

set ::auto_path "$::auto_path $dir"

package require tktopdf

3) By putting tktopdf into your packages directory.

In this case you will only need to add one line to your application:

package require tktopdf

 

How to use

To export a window, you need to do three steps:

1) first, you must pinpoint a pdf file name, and it's parameters. To do this you must use

tktopdf::startFile command, it's arguments are:

 

 -file Name of pdf file which will be created.
 ?-scalex? X scale factor (range from 0.1 to n.0)
 ?-scaley? Y scale factor (range from 0.1 to n.0)
 ?-marginleft? Size of left margin. *
 ?-marginright? Size of right margin. *
 ?-margintop? Size of top margin. *
?-marginbottom?
Size of bottom margin. *
?-pagex? X offset where the printed area appears in pdf file.
?-pagey?
Y offset where the printed area appears in pdf file.
?-rotatexy?
Rotation factor (one of 0, 90, 180, 270 (measured in degress)).
?-pagewidth?

A width of pdf file page.

?-pageheight? A height of pdf file page.
  * The size may be in centimeters, points, milimeters and pixels. Default:pixels

2) Next you must pinpoint which window you want to export:

tktopdf::exportWindow $windowName

2a) If you want to export more than one window you may use

tktopdf::nextPage

command, and then you must again call tktopdf::exportWindow with window's name you want to export

3) In the end, you must simply call

tktopdf::endFile

command, to acomplish whole process.

And now, if everything goes fine, you should get pdf file with exported window(s).

 

Sample use:

tktopdf::startFile -file "__test.pdf" \
        -scalex 1.0 -scaley 1.0 \
        -marginleft 0.25i -margintop 0.25i -marginright 0.25i -marginbottom 0.25i \
        -pagex 0 -pagey 0 \
        -rotatexy 0 -pagewidth 800 -pageheight 600
tktopdf::exportWindow .
tktopdf::endFile

 


or Cancel

Linking Wiki Pages

You can easily create page names and links using mediawiki-style templates.

[[Example Page]] will create a link to wiki page named 'Example Page' in the same space

[[#Section One]] will create a link to section 'Section One' in the same page. Note: 'Section One' should be formatted with heading tag (<h1> ... <h6>, Heading {N} from 'Format' dropdown in WISYWYG editor) show example

Also you can create a link to section from another page with [[Example Page#Section One]]

You can change link text with [[Example Page|Demo Wiki Page]]. This will work for section links too, by example: [[#Section One|First Section]], or even [[Example Page#Section One|First Section]]

Also, you can have links to tickets and other Assembla entities, like VCS revisions, files or images.

[[ticket:{number}]] - create a link to ticket numbered with {number}. A shortcut is available in the #{number} form.

[[revision:{id}]] - create a link to SVN, GIT or other supported SCM revision(changeset). Short version: [[r:{id}]]

[[file:{id_or_name}]] - create a link to a file from the current space. Note that you can use file ID if you know it, or file name, that one shown in File list.

[[image:{id_or_name}]] - create a 'img' html tag, where source is a image from the 'Files' tab. Useful in case you want to show an image from 'Files' inline in the page.

[[url:{url}]] - create a link to an external url, also you can have a custom link text with [[url:{url}|Link Text]] form.

[[space:{id_or_name}]] - create a link to space with {id_or_name}. Note that you can use space ID if you know it, or space name.

[[user:{login}]] - create a link to user's profile with {login}. Note that you can use the word {CURRENTUSER} to indicate the user logged in.

Note: '{}' is not part of the markup.



Also You can create page names and links with CamelCase. This assumes any word with two or more upper case characters separated by lower case characters is a page link.

You can use CamelCase without linking to any page, in that case just use ! sign in front of CamelCase word. E.g. !CamelCase

Note: You can disable CamelCase linking on Wiki Settings Page.

You can use a page name in a URL. Substitute an underscore (_) in place of any spaces. E.g. Wiki page becomes Wiki_page.

You may also specify a full path to link to pages outside of this space /page/space_name/page_name