XTransform Invert Function. Invert the transform. ABCpdf .NET PDF Library.

ABCpdf .net

 
   

Invert the transform.

 

   
Syntax  

[C#]
void Invert()

[Visual Basic]
Sub Invert()

 

   

Params
 
Name Description
None  

 

   

Notes
 

When you invert a transform a rotation clockwise becomes an identical rotation anti-clockwise. A translation to the left becomes a translation to the right. A zoom in becomes a zoom out.

Note that not every transform can be inverted. If you specify a magnification of zero you have shrunk your world space to a point. In this case it is not possible to invert the transform to get the original back again. However this kind of transform is uncommon in the real world and normally only occurs as a result of programming errors.

If you apply the invert method to a non-invertable transform the transform will remain unmodified.

 

   

Example
 

Here we add some text rotated at 45 degrees anti-clockwise around the middle of the document. We then invert the transform and draw some more text. Because the transform has been inverted the text now appears rotated 45 degrees clockwise.

[C#]
Doc theDoc = new Doc();
theDoc.FontSize = 72;
theDoc.Rect.String = "0 0 999 999";
theDoc.Pos.String = "302 396";
theDoc.Transform.Rotate(45, 302, 396);
theDoc.AddText("45 Degrees");
theDoc.Pos.String = "302 396";
theDoc.Transform.Invert();
theDoc.AddText("Inverted");
theDoc.Save(Server.MapPath("transforminvert.pdf"));
theDoc.Clear();

[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.FontSize = 72
theDoc.Rect.String = "0 0 999 999"
theDoc.Pos.String = "302 396"
theDoc.Transform.Rotate(45, 302, 396)
theDoc.AddText("45 Degrees")
theDoc.Pos.String = "302 396"
theDoc.Transform.Invert()
theDoc.AddText("Inverted")
theDoc.Save(Server.MapPath("transforminvert.pdf"))
theDoc.Clear()


transforminvert.pdf