asked on February 22, 2019
•
Show version history
I write this code:
static void Main(string[] args) { int documentid = some entry id; using (ClientManager lfclient = new ClientManager()) { PrintOptions printoptions = new PrintOptions(); Laserfiche.ClientAutomation.PageSet pages = new Laserfiche.ClientAutomation.PageSet(); printoptions.PageNumbers = pages; printoptions.DoNotPrompt = true; printoptions.DocumentPart = PrintType.Images; LaunchOptions launchOptions = new LaunchOptions(); launchOptions.ServerName = "ServerName"; launchOptions.RepositoryName = "RepositoryName"; launchOptions.UserName = "userName"; launchOptions.Password = "password"; ClientInstance singleLf; //ClientInstance client = lfclient.LaunchClient(launchOptions); //int pid = client.ProcessID; MainWindow mainwindow = null; //IEnumerable<ClientWindow> windows = client.GetAllClientWindows(); //foreach (ClientWindow window in windows) //{ // if (window.GetWindowType() == ClientWindowType.Main) // { // mainwindow = (MainWindow)window; // break; // } //} singleLf = lfclient.LogIn(launchOptions, out mainwindow); mainwindow.PrintById(documentid, printoptions); } }
My problem is ar this line: printoptions.DoNotPrompt = true;
When I change this to printoptions.DoNotPrompt = false; the program work and print the document, but when I try to change true this error apper:
If I let with false the window where you select your print and other options appers. I need to print directly. Please tell me where I have the error in the code when I change that line with true.
0
0