I want to programmatically edit a PDF using pyPDF. Currently, I'm struggling with interpreting the various PDF boxes' (TrimBox, MediaBox etc.) dimensions. Each box has four dimensions stored as a four-tuple, e.g.:
TrimBox: 56.69 56.69 1040.31 751.18
According to the PDF specification, these are supposed to describe a rectangle, and certainly (56.69, 56.69) determines the upper left corner of this rectangle. However, is (1040.31, 751.18) to be interpreted as the lower right corner of this rectangle, or as a vector relative to the upper left corner?
Apparently the answer is so well-known among typesetters that I couldn't find it explicitly spelt out anywhere I looked so far.