Dim caption As String = "Example: PackFonts"
Using gdpicturePDF As GdPicturePDF = New GdPicturePDF()
If gdpicturePDF.LoadFromFile("test.pdf", False) = GdPictureStatus.OK Then
If gdpicturePDF.PackFonts() = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test_optimized.pdf") = GdPictureStatus.OK Then
MessageBox.Show("The example has been followed successfully.", caption)
Else
MessageBox.Show("The file can't be saved. Status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The error occurs when optimizing fonts. Status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
Else
MessageBox.Show("The file can't be opened. Status: " + gdpicturePDF.GetStat().ToString(), caption)
End If
End Using
string caption = "Example: PackFonts";
using (GdPicturePDF gdpicturePDF = new GdPicturePDF())
{
if (gdpicturePDF.LoadFromFile("test.pdf", false) == GdPictureStatus.OK)
{
if (gdpicturePDF.PackFonts() == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test_optimized.pdf") == GdPictureStatus.OK)
{
MessageBox.Show("The example has been followed successfully.", caption);
}
else
{
MessageBox.Show("The file can't be saved. Status: " + gdpicturePDF.GetStat().ToString(), caption);
}
}
else
{
MessageBox.Show("The error occurs when optimizing fonts. Status: " + gdpicturePDF.GetStat().ToString(), caption);
}
}
else
{
MessageBox.Show("The file can't be opened. Status: " + gdpicturePDF.GetStat().ToString(), caption);
}
}