NAME

CairoX::Pager - pager for pdf , image surface backend.

VERSION

Version 0.02

DESCRIPTION

Cairo::PdfSurface supports pages , but image surface doesn't. this module page both pdf or image for you. for image type surface , we export page to a directory and give them a formatted name on finish_page method. for pdf surface , we create pdf document at start , and call cairo context show_page function to start a new page.

* svg , ps type surface are not supported yet.

SYNOPSIS

export pages pdf:

my $pager = CairoX::Pager->new(
    pdf => { filename => $filepath },
    page_spec => { width =>  , height => },
);

for ( ... ) {
    $pager->new_page( );

    my $surface = $pager->surface();   # get cairo surface 
    my $cr = $pager->context();    # get cairo context


    # draw something


    $pager->finish_page( );
}

$pager->finish();

export pages as svg :

my $pager = CairoX::Pager->new( 
    svg => { 
        directory => $path,
        filename_format => "%04d.png",
    },
    page_spec => { width =>  , height => },
);

export pages as png :

my $pager = CairoX::Pager->new( 
    png => { 
        directory => $path,
        filename_format => "%04d.png",
        dpi => 600,
    },
    page_spec => { width =>  , height => },
);

FUNCTIONS

new

current_filename

new_page

finish_page

finish

AUTHOR

c9s, <cornelius.howl at gmail.com>

BUGS

Please report any bugs or feature requests to bug-cairox-pager at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CairoX-Pager. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc CairoX::Pager

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

Copyright 2009 c9s, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.