PrintGetDocumentName Method (GdPictureImaging)
In This Topic
Returns the printer document name setting of the active printer. You can use it to display during the next print process (for example, in a print
status dialog box or printer queue) while printing the document.
Syntax
'Declaration
Public Function PrintGetDocumentName() As String
public string PrintGetDocumentName()
public function PrintGetDocumentName(): String;
public function PrintGetDocumentName() : String;
public: string* PrintGetDocumentName();
public:
String^ PrintGetDocumentName();
Return Value
The value of the active printer document name setting.
Example
Printing an image with the help of standard Windows Printer Dialog.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
// Open an image file. An empty string allows the control to prompt for selecting a file.
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
if (gdpictureImaging.PrintDialog(imageID) == false)
{
MessageBox.Show("Printing failed for " + gdpictureImaging.PrintGetDocumentName() +
"\nError: " + gdpictureImaging.PrintGetStat() +
"\nMessage: " + gdpictureImaging.PrintGetLastError(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
MessageBox.Show("Printing succeded for " + gdpictureImaging.PrintGetDocumentName(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Information);
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
Example
Printing an image with the help of standard Windows Printer Dialog.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
// Open an image file. An empty string allows the control to prompt for selecting a file.
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("");
if (gdpictureImaging.PrintDialog(imageID) == false)
{
MessageBox.Show("Printing failed for " + gdpictureImaging.PrintGetDocumentName() +
"\nError: " + gdpictureImaging.PrintGetStat() +
"\nMessage: " + gdpictureImaging.PrintGetLastError(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
MessageBox.Show("Printing succeded for " + gdpictureImaging.PrintGetDocumentName(), "Printing status", MessageBoxButtons.OK, MessageBoxIcon.Information);
// Release used resources.
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also