[pdftex] cm not reset after a figure inclusion

Heiko Oberdiek oberdiek at uni-freiburg.de
Tue May 15 00:18:07 CEST 2007


On Mon, May 14, 2007 at 02:23:51PM -0600, TeX Guy wrote:

> it appears that the cm is not reset after a figure inclusion if
> nothing else follows after the figure on the same page, or
> equivalently the state is not saved and restored around a figure
> inclusion. This has adverse side effects on page overlays.
> 
> For example
> [...]

> results in a page object
> 4 0 obj <<
> /Length 75
> >>
> stream
> 1 0 0 1 125.798 371.528 cm
> q
> 1 0 0 1 0 0 cm
> q
> 93 0 0 42 0 0 cm
> /Im1 Do
> Q
> Q
> endstream
> endobj


The page object is correct. There is no point in restoring anything
at the end of the page. BTW your image is surrounded by a
save (q)/restore (Q) pair.

> This is a problem, because when I overlay (via manipulation of PDF
> files) another page (with same MediaBox) onto the first one (think
> watermarking), e.g. /Type /Page /Contents [ 4 0 R 12 0 R ] etc.
> 
> the positioning of the overlay is affected by the (undefined?) state
> of the other page.

Indeed you can consider the state after the page stream as
undefined. But you can put the page stream in save/restore pairs
or put them into xform objects.

> Shouldn't the page objects be independent?

They are. The pages can be processed in any order.
This is unlike PS or DVI files. They can have the property
"page independency", but this is not true in general.
E.g., the second page of a PostScript file could rely on definitions
of the first page. Or the DVI file can contain colorstack instructions
for dvips.

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 


More information about the pdftex mailing list