Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.NewPDF()
If status = GdPictureStatus.OK Then
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft)
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitMillimeter)
Dim fontResName As String = gdpicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontHelvetica)
status = gdpicturePDF.GetStat()
If status = GdPictureStatus.OK Then
If (gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeA4) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.SetFillColor(255, 0, 0) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.SetTextSize(30) = GdPictureStatus.OK) AndAlso
(gdpicturePDF.DrawText(fontResName, 10, 50, "Here is some text") = GdPictureStatus.OK) Then
status = gdpicturePDF.SaveToFile("test_AddStandardFont.pdf")
If status = GdPictureStatus.OK Then
MessageBox.Show("Your prefered standard font has been successfully added and used in the newly created document.", "Example: AddStandardFont")
End If
Else
status = gdpicturePDF.GetStat()
End If
Else
MessageBox.Show("The AddStandardFont() method has failed with the status: " + status.ToString(), "Example: AddStandardFont")
status = GdPictureStatus.OK
End If
End If
If status <> GdPictureStatus.OK Then
MessageBox.Show("The example HAS NOT been followed successfully. The last error status is = " + status.ToString(), "Example: AddStandardFont")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.NewPDF();
if (status == GdPictureStatus.OK)
{
gdpicturePDF.SetOrigin(PdfOrigin.PdfOriginTopLeft);
gdpicturePDF.SetMeasurementUnit(PdfMeasurementUnit.PdfMeasurementUnitMillimeter);
string fontResName = gdpicturePDF.AddStandardFont(PdfStandardFont.PdfStandardFontHelvetica);
status = gdpicturePDF.GetStat();
if (status == GdPictureStatus.OK)
{
if ((gdpicturePDF.NewPage(PdfPageSizes.PdfPageSizeA4) == GdPictureStatus.OK) &&
(gdpicturePDF.SetFillColor(255, 0, 0) == GdPictureStatus.OK) &&
(gdpicturePDF.SetTextSize(30) == GdPictureStatus.OK) &&
(gdpicturePDF.DrawText(fontResName, 10, 50, "Here is some text") == GdPictureStatus.OK))
{
status = gdpicturePDF.SaveToFile("test_AddStandardFont.pdf");
if (status == GdPictureStatus.OK)
MessageBox.Show("Your prefered standard font has been successfully added and used in the newly created document.", "Example: AddStandardFont");
}
else
status = gdpicturePDF.GetStat();
}
else
{
MessageBox.Show("The AddStandardFont() method has failed with the status: " + status.ToString(), "Example: AddStandardFont");
status = GdPictureStatus.OK;
}
}
if (status != GdPictureStatus.OK)
MessageBox.Show("The example HAS NOT been followed successfully. The last error status is = " + status.ToString(), "Example: AddStandardFont");
gdpicturePDF.Dispose();