The following code creates a PDF document and adds a grid measured
in inches.
[C#]
Doc theDoc = new Doc();
theDoc.Units = UnitType.Inches;
theDoc.TopDown = true;
theDoc.Width = 1.0 / 8.0;
theDoc.FontSize = 1;
theDoc.Rect.Pin = XRect.Corner.TopLeft;
for (int i = 0; i <= 12; i += 2) {
theDoc.AddLine(0, i, 12, i);
theDoc.Rect.Position(0, i);
theDoc.AddText(i.ToString());
theDoc.AddLine(i, 0, i, 12);
theDoc.Rect.Position(i, 0);
theDoc.AddText(i.ToString());
}
theDoc.Save(Server.MapPath("doctopdown.pdf"));
theDoc.Clear();
[Visual Basic]
Dim theDoc As Doc = New Doc()
theDoc.Units = UnitType.Inches
theDoc.TopDown = True
theDoc.Width = 1.0 / 8.0
theDoc.FontSize = 1
theDoc.Rect.Pin = XRect.Corner.TopLeft
For i As Integer = 0 To 12 Step 2
theDoc.AddLine(0, i, 12, i)
theDoc.Rect.Position(0, i)
theDoc.AddText(i.ToString())
theDoc.AddLine(i, 0, i, 12)
theDoc.Rect.Position(i, 0)
theDoc.AddText(i.ToString())
Next
theDoc.Save(Server.MapPath("doctopdown.pdf"))
theDoc.Clear()
doctopdown.pdf
|
|
|