Beispiel #1
0
 public void TestConvertToPdfFile()
 {
     using (var kompas = new KomapsShell())
     {
         const string path = @"\Spc.spw";
         kompas.InitKompas(out var result);
         kompas.ConvertToPdf(StartupPath + path, StartupPath + @"\spc.pdf", out result);
         kompas.ExitKompas();
         Assert.IsTrue(string.IsNullOrEmpty(result));
     }
     Assert.IsTrue(File.Exists(StartupPath + @"\spc.pdf"), "Pdf file not found");
 }
Beispiel #2
0
 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");
 }
        public KompasConverter()
        {
            //c:\ProgramData\ASCON\Pilot_Print\tmp.xps
            PilotPrinterFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "ASCON\\Pilot_Print\\");
            tmpXps             = Path.Combine(PilotPrinterFolder, "tmp.xps");
            _komaps            = new KomapsShell();
            var isKompasInit = _komaps.InitKompas(out var message);

            if (!isKompasInit)
            {
                Logger.Error(message);
            }
        }