/// <summary>Windows GDI DOC_INFO structure</summary>
[StructLayout(LayoutKind.Sequential)]
public class DOC_INFO
{
/// <summary>
/// Specifies the size, in bytes, of the structure
/// Once the struct is initialsed use "cbSize = Marshal.SizeOf("the_structure_name") to set the value for cbSize correctly"
/// </summary>
public int cbSize = 0;
/// <summary>Pointer to a null-terminated string that specifies the name of the document</summary>
[MarshalAs(UnmanagedType.LPStr)]
public string pDocName = null;
///<summary>output file name (or NULL for a printer)</summary>
[MarshalAs(UnmanagedType.LPStr)]
public string pOutputFile = null;
/// <summary>Pointer to a null-terminated string that specifies the type of data used to record the print job.Can be null</summary>
[MarshalAs(UnmanagedType.LPStr)]
public string pDataType = null;
/// <summary>
/// Specifies additional information about the print job. This member must be zero or a set value
/// </summary>
public Int32 fwType = 0;
}
None.
Used in the StartDoc function in the gd132.dll
code snippet
DOC_INFO doc_info = new DOC_INFO();
doc_info.cbSize = Marshal.SizeOf(doc_info);
doc_info.pDocName = filename.ToString();
doc_info.pDataType = null;
doc_info.fwType = 0;
doc_info.pOutputFile = null;
// get printer hDC
StartDoc(hDC, doc_info);