Thanks for the information.
I adjusted the translation vector on setting the transformation matrix by taking the resolution into account. Please try the latest wxPdfDocument master. I hope this fixes the issue for you.
Thanks for the information.
Most likely this indicates that the translation vector is still not right. Could you please check the values of m_scaleX and m_scaleY in method SetTransformMatrix? Which values do these variables have? If they are not equal to 1, but relatively close to 1, you could try to simply remove them from the calculation and check whether that does the trick.
When applying a transformation in PDF it is necessary to apply a save and restore of the graphics state as well. If you set the pen and/or brush after setting a transformation matrix, then resetting the transformation matrix has unfortunately the side effect of reverting to the previous pen and/or brush as well. That is, you should either always set pen and brush explicitly after setting a transformation matrix, or do the setting of pen and brush before setting the transformation matrix.
In that case I really don't have an explanation why the rotated rectangle seems to be shifted.