[dvipdfmx] XObject form bounding box problem

Shunsaku Hirata shunsaku.hirata74 at gmail.com
Sat Jun 22 14:47:41 CEST 2019


Hi Petr,

I assume you are talking about XObject created via pdf:bxobj/pdf:exobj
special below.

> Hi, while working an optimizing PDF output from dvipdfmx I found some
> strange thing when working on XObject forms. It seems, that the \hoffset
> and \voffset are added to the bounding box and xobject matrix. So the
> code would shifted values by \hoffset resp. \voffset.

You mean the lower left corner of the bounding box is set to the current
position where pdf:bxobj is inserted and XObject's Matrix dicrionay entry
is adjusted accordingly?

I find no strangeness here, dvipdfmx is just using the easiest way to
capture the contents of a page: It adjusts BBox and Matrix of XObect
instead of converting coordinates values of each drawn objects.

> I think that in many of use cases this problem is masked as user use
> pdf:literal or pdf:content specials that inserts the correct cm matrix
> that correct the coordinates. But these additional matrixes are not
> needed without the problem above.

The cm operation is always required for pdf:content. It is intended for
drawing an isolated graphics object somewhere on the page.
The current point should be always selected as the origin inside
pdf:content special, not somewehre else.
Do you mean that the lower left corner of the page or XObject shold
be emplyoed for the origin?

> Is there a reason for adding \hoffset and \voffset to the bounding box?
> I think its a bug as isolated xobject should not be bounded to these
> values. Or I missed something?

I am not sure what is your intent here. Do you mean BBox should be
always something like [0 0 urx ury]?

I understand your point regarding pdf:code you mentioned in another
email but using pdf:content instead is the right way I think.

Thanks,
Shunsaku Hirata


More information about the dvipdfmx mailing list