Translate horizontally and vertically.




void Translate(double x, double y)

[Visual Basic]
Sub Translate(x As Double, y As Double)



Name Description
x The distance to translate to the right.
y The distance to translate upwards.




This method shifts the world space a specified distance up and to the right. Objects on the PDF will appear to translate upwards and to the right.




Here we draw two rectangles into our document. The black rectangle is drawn before the translation operation and the red one is drawn after it.


using (Doc doc = new Doc()) {   doc.Rect.Width = 200;   doc.Rect.Height = 250;   doc.Rect.Position(100, 100);   doc.Width = 20;   doc.FrameRect();   doc.Transform.Translate(200, 200);   doc.Color.String = "255 0 0"; // red   doc.FrameRect();   doc.Save(Server.MapPath("transformtranslate.pdf")); }