public static Print ( Diagram diagram, string printerName, string jobName, bool isWait ) : void | ||
diagram | Diagram | |
printerName | string | |
jobName | string | Job name. Can be null. |
isWait | bool | True to wait for the job to complete. False to return immediately after submitting the job. |
return | void |
public static void Print(Diagram diagram, string printerName, string jobName, bool isWait)
{
if (diagram == null)
throw new ArgumentNullException("document");
// Use Aspose.Diagram to convert the document to XPS and store in a memory stream.
MemoryStream stream = new MemoryStream();
diagram.Save(stream, SaveFileFormat.XPS);
stream.Position = 0;
Print(stream, printerName, jobName, isWait);
}
// ExEnd:XpsPrint_PrintDocument
XpsPrintHelper::Print ( Stream stream, string printerName, string jobName, bool isWait ) : void |
public static void Run() { // ExStart:PrintDiagramVisXPSPrinterAPI // The path to the documents directory. string dataDir = RunExamples.GetDataDir_Print(); // Load source Visio diagram Diagram diagram = new Diagram(dataDir + "Drawing1.vsdx"); // Specify the name of the printer you want to print to. const string printerName = @"\\COMPANY\Brother MFC-885CW Printer"; // Print the document. XpsPrintHelper.Print(diagram, printerName, "My Test Job", true); // ExEnd:PrintDiagramVisXPSPrinterAPI }