I am the beginner on unity, I want to print an image directly to connected default printer without preview.
I am using this code for print but it takes the preview
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PrintImage : MonoBehaviour
{
public void PrintFile()
{
PrintFiles();
}
void PrintFiles(string path=null)
{
path = "file:///C:/Users/ersai/Desktop/2.jpg";
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.CreateNoWindow = false;
process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
process.StartInfo.UseShellExecute = true;
process.StartInfo.FileName = path;
process.StartInfo.Verb = "print";
process.Start();
}
}
That's was not duplicate because this was not a window tag question I am asking about C# unity the question which tagged duplicate was not working with C# Unity. I am solved by LSPrinter Simple from assest store of unity.