GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / PrintGetDocumentName Method
Example





In This Topic
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.
Remarks
It is recommend to use the GetStat method or the PrintGetStat method to identify the specific reason for the method's failure, if any.

Just to inform you that the default value specified by the toolkit is "GdPicture Print Process".

Likewise to remind you that the active printer is the printer identified by the PrintGetActivePrinter method or set by the PrintSetActivePrinter method and it is dedicated to executing all subsequent print jobs using this class as well as utilizing all by you altered printer settings.

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