ssimms / pdfapi2

Create, modify, and examine PDF files in Perl
Other
15 stars 20 forks source link

Pagemode "SinglePage" unsupported #49

Closed sciurius closed 1 year ago

sciurius commented 2 years ago

By default PDF::API2 creates documents with pagemode 'SinglePage', however the page_mode method doesn't understand this.

use PDF::API2;

my $pdf = PDF::API2->new;
my $page = $pdf->page;
my $text = $page->text;
$text->translate( 100,100);
$text->font( $pdf->font("Times-Roman"), 20 );;
$text->text("Hello, World");
$pdf->save("x.pdf");

$pdf = PDF::API2->open("x.pdf");
warn("pagemode = ", $pdf->page_mode, "\n");
ssimms commented 1 year ago

This was due to the page_layout call incorrectly storing its value in the page_mode preference.