Post without Account — your post will be reviewed, and if appropriate, posted under Anonymous. You can also use this link to report any problems registering or logging in.
# text and gfx objects are output in the given order as objects/streams$grfx1 = $page->gfx(); $grfx1->save(); # start stream with q$grfx2 = $page->gfx(); $grfx2->restore();A # start stream with Q q $grfx2->save();$text1 = $page->text(); #$text1->restore(); nop #$text1->save(); nop$text2 = $page->text(); #$text2->restore(); nop
Text state. A subset of the graphics state parameters pertain to text, includingparameters that select the font, scale the glyphs to an appropriate size, andaccomplish other graphical effects.
$text->translate( 100, 500 );$text->text("text @ 100,500");$text->translate( 100, 100 );$text->text("text @ 100,100, not 200,600");
$text->translate(100, 100);$text->rotate(30);$text->text("rotated at 0,0");
$text->transform( -translate => [ 100, 100 ], -rotate => 30 );$text->text("rotated @ 100,100");
$pdf = PDF::API2->new();$page = $pdf->page();$page->strokecolor('blue');
A setting change (e.g., fillcolor) made to $text1 will be unchanged when later queried under $text1->fillcolor() ...
If there are any size limits on how much can be in a PDF object/stream, it could automatically split up content into multiple PDF objects.
AFAIK, such a change is registered in the (internal) object so a subsequent query will return the updated value.
If you need to split a stream at a given point, can you transfer the actual graphics state to the second part of the stream?