Prima::PS::Printer(3)
π Prima::PS::Printer(3) β PostScript & PDF printer bestie
okay so bestie, this is the Prima::PS::Printer(3) manual page from the User Contributed Perl Documentation, and it is literally giving βmake printers go brrr in PostScript and PDFβ energy. π
β¨
β¨ NAME
Prima::PS::Printer β PostScript and PDF interfaces to Prima::Printer. π¨οΈπ
πΈ SYNOPSIS
bestie, here's the whole vibe in code:
use Prima::PS::Printer;
my $x;
if ( $preview) {
$x = Prima::PS::Pipe-> new( command => 'gv $');
} elsif ( $print_in_file) {
$x = Prima::PS::File-> new( file => 'out.ps');
} elsif ( $print_on_device) {
$x = Prima::PS::LPR-> new( args => '-d colorprinter');
} elsif ( $print_pdf_file ) {
$x = Prima::PS::PDF::File-> new( file => 'out.pdf');
} else {
$x = Prima::PS::FileHandle-> new( handle => \*STDOUT );
}
$x-> begin_doc;
$x-> font-> size( 300);
$x-> text_out( "hello!", 100, 100);
$x-> end_doc;
π¦ DESCRIPTION
So what does it actually do? It realizes the Prima printer interface to PostScript level 2 document language through the Prima::PS::PostScript module, and to PDF v1.4 through the Prima::PS::PDF module. It allows different user profiles to be created and managed with the standard setup dialog. The module is designed to be compliant with the Prima::Printer interface. π
It also contains convenience classes (File, LPR, Pipe) for non-GUI use. lowkey iconic. π§
π¨οΈ Printer options
Below are the settings supported by the options method:
ColorSTRINGβ One of:"Color, Monochrome". πResolutionINTEGERβ Dots per inch. πPageSizeSTRINGβ One of:"Ainteger, Binteger, Executive, Folio, Ledger, Legal, Letter, Tabloid, US Common #10 Envelope". πCopiesINTEGERβ (not applicable to PDF). π¨οΈScalingFLOATβ1is 100%,1.5is 150%, etc. πOrientationβ One of:"Portrait","Landscape". πMediaTypeSTRINGβ An arbitrary string that represents special attributes of the medium other than its size, color, and weight. This parameter can be used to identify special media such as envelopes, letterheads, or preprinted forms. (not applicable to PDF). πMediaColorSTRINGβ A string identifying the color of the medium. (not applicable to PDF). π¨MediaWeightFLOATβ The weight of the medium in grams per square meter."Basis weight"or or null"ream weight"in pounds can be converted to grams per square meter by multiplying by3.76; for example,10-pound paper is approximately37.6grams per square meter. (not applicable to PDF). βοΈMediaClassSTRINGβ (Level 3) An arbitrary string representing attributes of the medium that may require special action by the output device, such as the selection of a color rendering dictionary. Devices should use the value of this parameter to trigger such media-related actions, reserving theMediaTypeparameter (above) for generic attributes requiring no device-specific action. TheMediaClassentry in the output device dictionary defines the allowable values for this parameter on a given device; attempting to set it to an unsupported value will cause a configuration error. (not applicable to PDF). π¨InsertSheetBOOLEANβ (Level 3) A flag specifying whether to insert a sheet of some special medium directly into the output document. Media coming from a source for which this attribute is Yes are sent directly to the output bin without passing through the device's usual imaging mechanism (such as the fuser assembly on a laser printer). Consequently, nothing painted on the current page is actually imaged on the inserted medium. (not applicable to PDF). π₯LeadingEdgeBOOLEANβ (Level 3) A value specifying the edge of the input medium that will enter the printing engine or imager first and across which data will be imaged. Values reflect positions relative to a canonical page in portrait orientation (width smaller than height). When duplex printing is enabled, the canonical page orientation refers only to the front (recto) side of the medium. (not applicable to PDF). πManualFeedBOOLEANβ A flag indicating whether the input medium is to be fed manually by a human operator (Yes) or automatically (No). A Yes value asserts that the human operator will manually feed media conforming to the specified attributes (MediaColor,MediaWeight,MediaType,MediaClass, andInsertSheet). Thus, those attributes are not used to select from available media sources in the normal way, although their values may be presented to the human operator as an aid in selecting the correct medium. On devices that offer more than one manual feeding mechanism, the attributes may select among them. (not applicable to PDF). πββοΈTraySwitchBOOLEANβ (Level 3) A flag specifying whether the output device supports automatic switching of media sources. When the originally selected source runs out of medium, some devices with multiple media sources can switch automatically, without human intervention, to an alternate source with the same attributes (such asPageSizeandMediaColor) as the original. (not applicable to PDF). πMediaPositionSTRINGβ (Level 3) The position number of the media source to be used. This parameter does not override the normal media selection process described in the text, but if specified it will be honored - provided it can satisfy the input media request in a manner consistent with normal media selection - even if the media source it specifies is not the best available match for the requested attributes. (not applicable to PDF). πDeferredMediaSelectionBOOLEANβ (Level 3) A flag determining when to perform media selection. If Yes, media will be selected by an independent printing subsystem associated with the output device itself. (not applicable to PDF). β³MatchAllBOOLEANβ A flag specifying whether input media request should match to all non-null values -MediaColor,MediaWeightetc. (not applicable to PDF). β
π AUTHOR
Dmitry Karasik, <dmitry@karasik.eu.org>. π
π SEE ALSO
Prima, Prima::Printer, Prima::Drawable, Prima::PS::PDF. π¦πΈ
mwah π this lil page is from the User Contributed Perl Documentation, perl v5.42.0, dated 2024-08-20, and it is the Prima::PS::Printer(3) manual page β periodt. π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- opensuse-leap 16.0: perl-Prima 1.74000-bp160.1.13 Β· AGPL-3.0-only AND BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms