Scroll to navigation

Prima::PS::PDF(3) User Contributed Perl Documentation Prima::PS::PDF(3)

NAME

Prima::PS::PDF - PDF interface to Prima::Drawable

SYNOPSIS

Recommended usage:

        use Prima::PS::Printer;
        my $x = Prima::PS::PDF::File-> new( file => 'out.pdf');

or

        my $x = Prima::PS::PDF::FileHandle-> new( handle => \&STDOUT);

Low-level:

        use Prima::PS::PDF;
        my $x = Prima::PS::PDF-> create( onSpool => sub {
                open F, ">> ./test.pdf";
                binmode F;
                print F $_[1];
                close F;
        });

Printing:

        die "error:$@" unless $x-> begin_doc;
        $x-> font-> size( 30);
        $x-> text_out( "hello!", 100, 100);
        $x-> end_doc;

DESCRIPTION

Implements the Prima library interface to PDF v1.4. The module is designed to be compliant with the Prima::Drawable interface. All properties' behavior is as same as Prima::Drawable's except those described below.

Inherited properties

::resolution
Can be set while the object is in the normal stage - cannot be changed if the document is opened. Applies to implementation of the fillPattern property and general pixel-to-point and vice versa calculations

Specific properties

could be 0 or 1
The physical page dimension, in points
Non-printable page area, an array of 4 integers: left, bottom, right, and top margins in points.
if 1, a 90 degrees rotated document layout is assumed

Internal methods

Helpers for translation from pixel to points and vice versa.
Prima::PS::PDF is not responsible for the output of the generated document, it only calls the "::spool" method when the document is closed through an "::end_doc" call. By default discards the data. The "Prima::PS::Printer" class handles the spooling logic.
Calls Prima::Application::fonts and returns its output filtered so that only the fonts that support the "iso10646-1" encoding are present. This effectively allows only unicode output.
2024-02-01 perl v5.38.2