.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.07) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Gtk2::Ex::PrintDialog 3pm" .TH Gtk2::Ex::PrintDialog 3pm "2010-02-14" "perl v5.10.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Gtk2::Ex::PrintDialog \- a simple, pure Perl dialog for printing PostScript data in GTK+ applications. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Gtk2::Ex::PrintDialog; \& \& my $dialog = Gtk2::Ex::PrintDialog\->new; # a new dialog \& \& $dialog\->set_data($postscript_data); # supply some postscript data \& \& $dialog\->set_filename($postscript_file); # get postscript from a file \& \& $dialog\->run; # show the dialog to the user .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module implements a dialog widget that can be used to print PostScript data. It is intended to be a lightweight and pure-perl alternative to the Gnome2::Print libraries. .PP This module uses a simple system of operating-system specific backends that are used to do the job of printing. Currently, only a generic Linux/Unix backend (implemented using Net::CUPS) is available, more will be added in the future. .PP The dialog itself is intended to comply with the \s-1GNOME\s0 Human Interface Guidelines (\s-1HIG\s0). It allows the user to print to any printer installed on the system, or to an external command such as \f(CW\*(C`lpr\*(C'\fR, or to print a PostScript or \&\s-1PDF\s0 file. .PP This module is \s-1UNSTABLE\s0, the behaviour and \s-1API\s0 of its components may change in the future. .SH "OBJECT HIERARCHY" .IX Header "OBJECT HIERARCHY" .Vb 8 \& Glib::Object \& +\-\-\-\-Gtk2::Object \& +\-\-\-\-Gtk2::Widget \& +\-\-\-\-Gtk2::Container \& +\-\-\-\-Gtk2::Bin \& +\-\-\-\-Gtk2::Window \& +\-\-\-\-Gtk2::Dialog \& +\-\-\-\-Gtk2::Ex::PrintDialog .Ve .SH "METHODS" .IX Header "METHODS" .Vb 1 \& my $dialog = Gtk2::Ex::PrintDialog\->new; .Ve .PP Returns an instance of \f(CW\*(C`Gtk2::Ex::PrintDialog\*(C'\fR. These dialogs are subclasse of \f(CW\*(C`Gtk2::Dialog\*(C'\fR so all corresponding methods, signals and properties from that class are also available. .PP The dialog will handle user actions itself so you will probably not need to connect to any signals. .PP .Vb 1 \& $dialog\->set_data($data); .Ve .PP This tells the dialog to use the PostScript data in \f(CW$data\fR. This might be PostScript data you create yourself, or from another application. This data can subsequently retrieved using \f(CW\*(C`get_data()\*(C'\fR. .PP .Vb 1 \& $dialog\->set_filename($file); .Ve .PP This tells the dialog to use the PostScript data in \f(CW$file\fR. The file name can be subsequently retrieved using \f(CW\*(C`get_filename()\*(C'\fR. The contents of the file are read into memory when \f(CW\*(C`set_filename()\*(C'\fR is called, so any subequent calls to \f(CW\*(C`get_data()\*(C'\fR will return the contents of \f(CW$file\fR. .SH "LOCALISATION ISSUES" .IX Header "LOCALISATION ISSUES" If the \f(CW\*(C`Locale::gettext\*(C'\fR module is available on the system, and your application uses it, all the strings used in the dialog will be automagically translated, as long as these default values are translated in your .mo files. .SH "WRITING BACKENDS" .IX Header "WRITING BACKENDS" Backends are Perl modules with names of the form .PP .Vb 1 \& C .Ve .PP See perlvar for details of the \f(CW$^O\fR variable. The module must have the following methods: .ie n .IP """$backend = Gtk2::Ex::PrintDialog::$^O\->new""" 4 .el .IP "\f(CW$backend = Gtk2::Ex::PrintDialog::$^O\->new\fR" 4 .IX Item "$backend = Gtk2::Ex::PrintDialog::$^O->new" The constructor. .ie n .IP """$backend\->get_printers""" 4 .el .IP "\f(CW$backend\->get_printers\fR" 4 .IX Item "$backend->get_printers" Returns an array of printer names. .ie n .IP """$backend\->print_file($printer, $file)""" 4 .el .IP "\f(CW$backend\->print_file($printer, $file)\fR" 4 .IX Item "$backend->print_file($printer, $file)" Prints the contents of \f(CW$file\fR to the printer named \f(CW$file\fR .ie n .IP """$backend\->get_default_print_command""" 4 .el .IP "\f(CW$backend\->get_default_print_command\fR" 4 .IX Item "$backend->get_default_print_command" Returns the path to the default print command, if applicable (eg '\f(CW\*(C`lpr\*(C'\fR') .ie n .IP """$backend\->can_print_pdf""" 4 .el .IP "\f(CW$backend\->can_print_pdf\fR" 4 .IX Item "$backend->can_print_pdf" Returns a true value if \s-1PDF\s0 printing is supported, \f(CW\*(C`undef\*(C'\fR otherwise. .ie n .IP """$backend\->print_to_pdf($data, $file)""" 4 .el .IP "\f(CW$backend\->print_to_pdf($data, $file)\fR" 4 .IX Item "$backend->print_to_pdf($data, $file)" Prints the PostScript data in \f(CW$data\fR to the \s-1PDF\s0 file named \f(CW$file\fR. .Sp Consult Gtk2::Ex::PrintDialog::Unix for an example. Please note that this interface may change in the future. .SH "PREREQUISITES" .IX Header "PREREQUISITES" .IP "Gtk2" 4 .IX Item "Gtk2" .PD 0 .IP "Locale::gettext (recommended)" 4 .IX Item "Locale::gettext (recommended)" .IP "Net::CUPS (for the Unix/Linux backend)" 4 .IX Item "Net::CUPS (for the Unix/Linux backend)" .ie n .IP "Ghostscript, for the ""ps2pdf"" command (recommended)" 4 .el .IP "Ghostscript, for the \f(CWps2pdf\fR command (recommended)" 4 .IX Item "Ghostscript, for the ps2pdf command (recommended)" .PD .SH "SEE ALSO" .IX Header "SEE ALSO" Gnome2::Print provides Perl bindings to the \*(L"offical\*(R" \s-1GNOME\s0 printing library. If you want a simple way to generate PostScript data, consider PostScript::Simple. .SH "TO DO" .IX Header "TO DO" .ie n .IP "Implement a ""Print Preview"" function, maybe using Poppler." 4 .el .IP "Implement a ``Print Preview'' function, maybe using Poppler." 4 .IX Item "Implement a Print Preview function, maybe using Poppler." .PD 0 .IP "More backends." 4 .IX Item "More backends." .PD .SH "AUTHOR" .IX Header "AUTHOR" Gavin Brown (gavin dot brown at uk dot com) .SH "COPYRIGHT" .IX Header "COPYRIGHT" (c) 2005 Gavin Brown. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.