Dim gdpicturePDF As New GdPicturePDF()
Dim status As GdPictureStatus = gdpicturePDF.LoadFromFile("test.pdf", False)
If status = GdPictureStatus.OK Then
'The specified preference will be enabled.
status = gdpicturePDF.SetViewerPreference(PdfViewerPreference.PdfViewerPreferenceFitWindow, True)
If status = GdPictureStatus.OK Then
'The specified preference will be enabled.
status = gdpicturePDF.SetViewerPreference(PdfViewerPreference.PdfViewerPreferenceHideWindowUI, True)
If status = GdPictureStatus.OK Then
'The specified preference will be disabled.
status = gdpicturePDF.SetViewerPreference(PdfViewerPreference.PdfViewerPreferenceDisplayDocTitle, False)
If status = GdPictureStatus.OK Then
If gdpicturePDF.SaveToFile("test_SetViewerPreference_func.pdf", False) = GdPictureStatus.OK Then
MessageBox.Show("Your specified preference settings have been set successfully.", "Example: SetViewerPreference")
End If
Else
MessageBox.Show("The SetViewerPreference() method has failed with the status: " + status.ToString(), "Example: SetViewerPreference")
End If
Else
MessageBox.Show("The SetViewerPreference() method has failed with the status: " + status.ToString(), "Example: SetViewerPreference")
End If
Else
MessageBox.Show("The SetViewerPreference() method has failed with the status: " + status.ToString(), "Example: SetViewerPreference")
End If
Else
MessageBox.Show("The file can't be loaded.", "Example: SetViewerPreference")
End If
gdpicturePDF.Dispose()
GdPicturePDF gdpicturePDF = new GdPicturePDF();
GdPictureStatus status = gdpicturePDF.LoadFromFile("test.pdf", false);
if (status == GdPictureStatus.OK)
{
'The specified preference will be enabled.
status = gdpicturePDF.SetViewerPreference(PdfViewerPreference.PdfViewerPreferenceFitWindow, true);
if (status == GdPictureStatus.OK)
{
'The specified preference will be enabled.
status = gdpicturePDF.SetViewerPreference(PdfViewerPreference.PdfViewerPreferenceHideWindowUI, true);
if (status == GdPictureStatus.OK)
{
'The specified preference will be disabled.
status = gdpicturePDF.SetViewerPreference(PdfViewerPreference.PdfViewerPreferenceDisplayDocTitle, false);
if (status == GdPictureStatus.OK)
{
if (gdpicturePDF.SaveToFile("test_SetViewerPreference_func.pdf", false) == GdPictureStatus.OK)
MessageBox.Show("Your specified preference settings have been set successfully.", "Example: SetViewerPreference");
}
else
{
MessageBox.Show("The SetViewerPreference() method has failed with the status: " + status.ToString(), "Example: SetViewerPreference");
}
}
else
{
MessageBox.Show("The SetViewerPreference() method has failed with the status: " + status.ToString(), "Example: SetViewerPreference");
}
}
else
{
MessageBox.Show("The SetViewerPreference() method has failed with the status: " + status.ToString(), "Example: SetViewerPreference");
}
}
else
{
MessageBox.Show("The file can't be loaded.", "Example: SetViewerPreference");
}
gdpicturePDF.Dispose();