PrintingSnippets
These snippets illustrate how to perform various printing
operations. In the current CommonPoint(TM) release, they use the
default printer that is created the first time you launch the
CommonPoint application system and use the printing resources.
Running the snippets
To run the snippets, use either the SnippetBrowser or RunSnippet
utilities. RunSnippet can be invoked like this:
- RunSnippet TPrintingSnippets PrintingSnippets
Files and classes
TPrintingSnippets, defined in PrintingSnippets.h and
PrintingSnippets.C, defines snippets that illustrate how to perform
various printing operations. It uses classes such as TPrinter,
TPrintJobDescription, TPrintChannel, TPaginatedPageFolio,
TStandardPageRange, and TStandardPageDescription to perform various
printing tasks such as printing a range of pages, n-up printing, and
compositing.
TSamplePageNumberCompositor, defined in
SamplePageNumberCompositor.h and SamplePageNumberCompositor.C, derives
publicly from TPrintPageIterator and privately from TPage, to put a
page number on the top of each page. It is used in the
PrintPagesWithPageNumber snippet of TPrintingSnippets.
Notes
The printing snippets do not display messages as the other
snippets do, but simply perform the printing tasks specified. If a
printer is defined, these tasks will print to that printer.
It is possible to have the snippets print to postscript files in
$TaligentRoot/RuntimeEnv/Data. These files are named PrintFile0,
PrintFile1, and so on. If you have displayps enabled, you can view
these files with showps by following these steps:
1) Stop the CommonPoint system
2) cd to $TaligentRoot/RuntimeEnv/Data and rm -r Printers
3) unsetenv PRINTER
When you restart the CommonPoint system, the next time the system
needs a default printer, it will find that none exists and attempt to
create a new one. If the PRINTER environment variable is not set, it
creates a default system printer that spools postscript files to
$TaligentRoot/RuntimeEnv/Data as described.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.