public void KompasConvertToXps(List <Specification> listSpc) { if (listSpc == null) { return; } foreach (var spc in listSpc) { var fileName = spc.FileName; if (!File.Exists(fileName)) { continue; } var isConvert = _komaps.PrintToXps(fileName); if (!isConvert) { continue; } var xpsFile = Path.Combine(PilotPrinterFolder, Guid.NewGuid() + XPS_EXT); Thread.Sleep(1000); if (Utility.IsFileMove(tmpXps, xpsFile)) { spc.PreviewDocument = xpsFile; } Utility.TryDeleteFile(tmpXps); } }
public void TestPrintCdwOneFormatToXpsFile() { ClearFolder(); using (var kompas = new KomapsShell()) { const string path = @"\078.505.0.0102.00.A3.CDW"; kompas.InitKompas(out var result); kompas.PrintToXps(StartupPath + path); kompas.ExitKompas(); Assert.IsTrue(string.IsNullOrEmpty(result)); } Assert.IsTrue(IsXpsFile(), "Tmp xps file not found"); }